Repository navigation
Say which of your comments were waiting when a version was saved - #5716
Conversation
…ered
With a comparison on (`v`, or a Compare in Versions), the ⇄ entry's label
said what a change did, "1 paragraph edited since v1", but not why. Under
that line it now says where the change landed and what the revision that
made it answered, with the opening line of each message the user wrote:
1 paragraph edited since v1
In v2, answering your comment:
“Why ship with that?”
A change made once every comment was answered says *In v3, answering
none of your comments*; one made while a comment waits for its answer
says *In Draft, after your comment:*, which becomes *answering* once the
agent answers it. A change several revisions made for different things
says each in turn. The headings are Leaf's, in its italic; the quotes are
the user's words. The `h` walk says the same to a listener after the
walk's position. A change of state alone, such as a pick, has no line.
**Derived once, in Python (`provenance.py`).** The log never links a
revision to the reply it answers: a tab reading the page activates each
save as a revision with no event naming it, so `publication` is on 7 of
the 184 answers in this month's page logs under `~/.tmp`. What the log
does order is each message against the revisions named by then, so a
revision answers the messages sent before it whose answer came first after
it; a message still owed counts as answered after every revision, which
is the waiting case. `revision_answers` rides every browser reading
(linear in the log, 19 ms for 4,000 threads). Which elements each
revision changed, `revision_changes`, rides the `/api/view` answer for a
comparison's base only, since it reads each revision's words: a unit is an
element with an id and the words directly in it (`SourceReading
.own_words`), about 5 ms a revision on a 120,000-character page, kept with
the revision's reading.
**Selected in the browser.** The block diff is the browser's, so
version.js gives each change the revisions that changed a unit its blocks
stand in (`madeBy`), and `change-provenance.js` selects from the readings:
the version each revision landed in (the first stamp at or after it, else
Draft) and each message as its thread now reads it. `changeProvenance(change)`
is the one value a surface reads, `{groups, lines}`; the label adds its
lines under the account, broken by `white-space: pre-line` on the entry's
context.
`events.settlements` is the one walk of a thread's turns that says which
messages each answer settled; `settled_through` now reads it, unchanged
in what it returns.
**Calls.** "Unprompted" would misstate work asked for in the terminal,
which the page can't see, so an unasked change says it answered none of
the user's comments. The rule reads order: an answer in words sent before
the revision made for it hands that revision to the next answer, two
messages answered together share every revision since the first, and
paragraphs without ids share their element's unit. On the same pages, of
the 130 revisions the rule gave one anchored comment, 68% changed that
element, one inside it or one around it. Widget choices, which a stamped
version takes in, aren't attributed. The Versions list keeps its one-line
rows, and a comment saying which version answered it is not drawn; the
served reading supports both.
No protocol bump: the log means what it did; the served state gains
`browser.revision_answers` and the `/api/view` answer `changed`.
**Checks.** `tests/model/test_provenance.py` holds the derivation and the
unit changes; `tests/runtime/change-provenance.test.mjs` the words; and
`test_a_change_says_which_comment_it_answers` the three cases on a served
page, through the CLI's own reply. The thread, workflow, delivery and
served-schema model tests, the comparison browser tests and `pnpm run
check` pass. The ⇄ label was read in Chromium and Firefox, light and dark,
on `review-a-plan` and a four-version fixture.
The ⇄ label's attribution said a change was "answering your comment" and
that one made once every comment was answered was "answering none of your
comments". The rule behind it reads the log's order, and neither claim is
one the log can back, so the label now says the order it reads:
1 paragraph edited since v1
In v2, after your comment:
“Why ship with that?”
A change made once every comment was answered says *In v3, with none of
your comments waiting*, which is true of the revision made after a quick
answer that the instructions ask for. "After" covers both a comment since
answered and one still owed, so the served reading drops `answered`:
`browser.revision_answers` becomes `browser.revision_messages`, by
revision the messages a revision came after, and `provenance.revision_answers`
becomes `revision_messages`.
**Measured.** A rule scoped by each turn's pickup was tried against the
order rule on the same logs: the 39 pages with pickups among this month's
page logs under `~/.tmp`, 1,815 revisions. The locality proxy is the share
of revisions given one anchored comment, with changed words, that changed
the commented element, one inside it or one around it; any revision paired
with any earlier comment scores 17%.
| Rule | One message | Several | None | Near |
|---|---|---|---|---|
| Order (kept) | 13.6% | 2.8% | 83.6% | 68% of 130 |
| Latest pickup, then the last answered | 48.8% | 1.3% | 49.9% | 24% of 515 |
| Latest pickup, last answered only in its turn | 31.6% | 1.3% | 67.1% | 37% of 286 |
| Latest pickup, no after-answer branch | 14.1% | 0.5% | 85.3% | 69% of 122 |
| Latest pickup, then the order rule | 15.7% | 0.7% | 83.6% | 67% of 136 |
The after-answer branch, where a revision made after a quick answer would
go to that comment, was below chance: 10% of 393, and 14% of the 164 made
while that comment's turn still ran. The pickup scope before an answer did
as well as the order rule and gave fewer revisions several messages, but
where the two disagreed its one message was near in 3 of 8 cases against
8 of 16 for each of the order rule's: a pickup mid-turn lists only what
newly arrived. So the pickup rule bought nothing the measure could see,
lives only in the measurement, and isn't kept; `provenance.py`'s header
records it. Both rules cost about a millisecond over all 39 pages.
68% is four times chance and not a level for a label that states a cause,
so every heading states order. What the order rule still gets wrong: two
messages answered together share every revision since the first (2.8%),
32% of its single-comment revisions changed something else, and a
revision after a quick answer goes to the next message still waiting, if
any.
**Checks.** The provenance model tests, the words' runtime test, the
served-page test (now `test_a_change_says_which_comment_it_came_after`),
the served-schema process test and `pnpm run check` pass; the label was
read in Chromium and Firefox on `review-a-plan` and the four-version
fixture.
…y and value
Hovering, keyboard focus and a held finger now read one preview, drawn by
runtime/preview.js beside its target in the tooltip face (or the popover face for a
passage of words). It stands in a `popover="hint"` in the top layer, anchored to its
target by CSS anchor positioning, takes no pointer, holds no control and moves
nothing. One shows at a time: after a 200 ms dwell for a pointer (at once when warm),
at once for focus the browser shows, and after the same dwell under a finger, whose
release still presses. Leave, blur, a press, any key (for a pointer's) and Escape put
it away; Escape still takes its own step, so dismissing a preview never costs a press.
What a target previews:
- An element declares `lfPreview()` (module-input.md, "Previews"): words, a template,
`{popover: words}`, or null. No import, so a portable widget reads nothing off Leaf.
- A control previews its accessible name where its face is a symbol, its
`aria-description`, and every key that presses it as `.lf-key-badge` chips, from the
register (`controlKeys` in keyboard/control-keys.js).
- A range's owner calls `pointRange(range, read, at)`, for the passage marks to come.
Every key that presses a control is named. A row that presses another command's button
names it as `control` with no `run`, so the button keeps one command: `r` now presses
Resolve and `Mod+c` a message's Copy that way, and the chosenCommand refusal says so.
Send's preview names the box's send key through `pressPreview`: naming Send as
`text.send`'s control would make Enter unavailable whenever Send is aria-disabled, and
lose the "Nothing to send" announcement an empty box gives.
The platform `title` goes from every control the owner serves: role constructors,
nameAction, closeControl and control-keys no longer write it, and the `{title}` option
is gone. Hand-written key suffixes ("(Esc)", "(⏎)") go with it.
Moved onto the owner, their own handling deleted:
- held-word.js, HOLDS_WORD and data-lf-held-word: the owner's hold covers margin
entries, reactions, a diff's cut path and every other previewing target.
- The margin entry's label and the ⇄ change entry's: the label element, its placement
pass (which measured every entry on the page on every hover) and its CSS. The label
now wraps whole instead of cutting its question to one line, and may cover a
neighbouring entry, which still takes the pointer through it; the test that held
neighbour avoidance is deleted.
- The folded leaf's status peek: hover and focus state, exposure snapshot and the
reading-continuity reset. The peek element stays as the folded panel's notice seat.
- lf-gloss: hover and focus tracking. The phrase previews its explanation; a press
pins the card, where its words can be selected and commented on.
- The trace timeline's tip: its element, anchor, hover handlers and CSS.
- A trace image scale's and pace select's titles became aria-descriptions; the
transport buttons are named "Previous capture" and "Next capture".
Supporting changes: a hint popover joins no layer stack, so the dispatcher tiers no
scope over it and closing it hands nobody back; content-layout no longer re-reads the
document for toggles in Leaf's chrome; a preview of something that arrives under a
still pointer, or one reached while a press is carried, does not show; a hidden tab
hides the preview. The feature gallery's fixed samples suppress their previews through
`lfPreview` instead of a theme rule on the old label.
Docs: browser/AGENTS.md gains "Pointing reads; pressing acts" and reconciles "Controls
are few and quiet"; interface-goals.md, module-input.md, module-authoring.md,
keyboard/AGENTS.md ("Touch routes", "Escape") and the glossary follow.
Tests: test_previews.py holds a control's word and key chip, that it moves nothing,
the focus route, Escape, and a range's placement. Tests that read the margin label,
the peek, held words, the trace tip, titles and the diff path's generated word now
read the preview; a stills state, control-preview, shows Resolve's.
…e per hover
A fresh look at the first round's captures, a code review, and four branches building
on the owner (thread previews and ages, link previews, chart values) found five
layouts, a dismissal that cost the open thread, tooltips crowding what they stood by, a
contract that replaced a control's own words, and a rule added to the document for each
widget control a hover reached.
The contract. `lfPreview(route)` is called once as a preview shows, with the route that
asked ("pointer", "focus" or "hold"), and returns `{name, keys, detail, at, excerpt}`,
every field optional: lines under the control's own name and key chips, which `name`
replaces where the accessible name says more than the face should. `at` is where the
preview stands, the declaring element by default: another element, as a message's age
stands by its `<time>`, or a box in client coordinates inside the element, as a chart's
value stands above its point. `excerpt: true` gives a preview quoting a block of the
page, as a link's place, the face's wider room. `null` adds nothing, so the search goes
on outward; `false` shows nothing here or around it, as a pinned gloss card. What a
declaration throws is reported and shows nothing. `previewChanged(element)`
(portable-api.js) says an element's preview changed while the aim stayed on it, as a
chart's pointer reaches another point or a grabbed card's grip goes quiet: a standing
preview redraws in place with no fade, or the route reading the element shows it. The
lf-trace marks, the gloss, the diff row, the margin entries, Send, the leaf and the
board's grip declare this way; the chart, link and thread branches convert from
`{popover}`, bare words and `{words, at}` to it.
A control's own preview is its accessible name where its face shows a symbol or doesn't
say that name, keyed on the face rather than `data-lf-gen`, and the keys that press it.
An options pick ("choose one: Hold approval — option 1 of 2"), a diff gutter number and
a tab no longer preview their screen-reader names, and a hand-built symbol button does.
`aria-description` stays a screen reader's: a diff row's names its path, which the row
shows.
A `title` is an element's words like any other. The portable writers keep writing it
(element-markers.js, `nameAction`), so a widget off Leaf shows the browser's tooltip;
on Leaf the preview reads it on every route, taking it off the element the first time
the pointer comes so the browser shows no second tooltip, and taking it again with new
words when the writer writes another. That moves the thirty-odd titles the runtime and
packages still write onto every route with no edit at each. Holding it off only while
the pointer rested there and putting it back after wrote it twice a hover, which the
write watch flags as an unchanged write and a screen reader hears as the element's
description changing. The cost: a writer's removal of a title already taken removes
nothing, so its words stay until it writes another. Authored markup's titles go the
same way: they gain the keyboard and a finger, at the price of the author's attribute,
which Leaf takes as the one guarantee in play, that every result a pointer reaches has
a keyboard and a touch route.
Escape is a standing preview's own step. While one shows, by pointer or by focus,
Escape puts it away and does nothing else (a `preview` page scope with
`escape: "inner"`, first in the register's STACK); the next Escape takes the step it
stood in front of. With Resolve's preview showing, one Escape had hidden it and closed
the thread card it covered. This follows WCAG 1.4.13 and the WAI-ARIA tooltip pattern.
Any other key still puts a pointer's preview away and does its own work. Focus the
runtime hands back, as a closing surface returns the user to what opened it, previews
nothing, since a preview there would take the Escape the user is backing out with.
The cost, measured on 65 tests that press Escape (48 drawn at random from the 441 that
do, and the 17 named for Escape), each run on this commit and again with the preview's
step turned off: 9 fail only with it, because a focus preview stood on the control
focus had reached when the test pressed Escape, as the Page Map's first row, a margin
card's first control or a thread's Resolve; 7 of them are in the random draw, so about
one Escape journey in seven (Wilson 95% interval 1 in 14 to 1 in 4) now takes one more
press. Not previewing focus the runtime hands back recovered 3 more. 9 others fail with
the step off too, as they do on 6b3159d. The 9 still expect one press and are not
changed here.
One face with fixed slots: the name at the face's weight with its key chips, then each
line of detail in the same type a step dimmer. The popover face for previews is gone:
a gloss previews its phrase and explanation in the tooltip face, and a press pins the
paper card. The folded leaf previews "Unfold Leaf" with its `.` key over the page's
status, and the expanded leaf "Page menu". Trace marks name their moment, input or call
and put its time and checkpoint on lines of their own, and a shared label previews "2
moments" over one line each. Send previews ⏎ and, where Return sends, "New line ⇧⏎".
Words Leaf itself says keep their italic in the detail, as the glossary's voice rule
has them on every seat. A preview on keyboard focus shows at once, with no fade.
Spacing: the preview stands below its target with its end edge in line with the
target's, so a control at a card's edge keeps it inside the card, flipping to the start
edge and above where the window has no room. Its gap is the focus ring's room plus 6px,
so a ring never meets it and the folded leaf's badge has air; a held finger sees it
22px further up. Esc chips: the `close` action in ACTIONS names Escape, and
`controlKeys` reads the action a control shows, so Page Map, About this page, the
thread card's ✕, the visual review's ✕ and the panel's ✕ show it from that one place.
Anchoring: a target in the document stands the preview by the name `anchorName` gives
it, an inline style; a target in a widget's shadow tree, or a box a declaration names,
stands it by one of two places of the owner's own, set over the box by insets from the
nearest box in the document. Naming the shadow-tree box declared a `::part()` rule for
each new one, kept for the session. On pr-walkthrough's 115 shadow-tree controls in
Chromium, a first visit cost 2.3 ms with 69 rules added (1,157 elements) and 5.4 ms with
86 (7,155, the page grown by 6,000 paragraphs); now each show costs 0.3 ms and 1.0 ms
with none added. Moving one name between targets, the review's proposal, cost 1.8 ms and
7 ms per show, since Chromium restyles the page when an anchor's name moves; Firefox
pays nothing either way. Two places take turns so a preview whose anchor changed is
placed afresh rather than first where the last target's fallback put it.
Screen readers: every preview shown on focus describes the focused element while it
stands, whatever supplied it, except a control's own, which says only what its name and
`aria-keyshortcuts` do, and a proxy's; the description it had comes back after, with no
empty `aria-describedby` left behind. `aria-keyshortcuts` now holds every one-press key
its chips draw beside the keys its own scopes take (control-keys.js,
`controlShortcuts`), so Resolve says `r` beside Enter and Space; Send writes its own
from `sendBindings`, the list its chip reads.
Routes: a range's owner may make its range again on every move, which points at the
same range. A key on an element a click focused counts as the keyboard's in Firefox for
a changed preview. A finger held past the dwell reads wherever it slides, so one that
crossed a gap between neighbours reads the next it reaches. The board's grip says its
keys only as chips and its drag in a line of detail, and goes quiet while its card is
grabbed.
The own-command branch in `controlKeys` stays: it serves commands a scope declares
away from the control they claim, such as the image viewer's `z` and its close; its
comment named Send, whose key is the box's own `text.send`, which sends rather than
pressing Send, so the box declares it.
Tests: the preview tests run in Chromium and Firefox; the Escape test fails without the
preview's step; `preview_parts` reads what the pointer route shows rather than calling
`lfPreview()`; the obligation marker measures cuts on the face's box; a focus preview
describes the margin entry it stands on.
…s own blocks Review of thread-previews found three faults in the change attribution, each reproduced here first. **A revision's messages were recomputed from every thread's current state.** `revision_messages` listed, for every revision, the messages it came after, so 512 threads waiting across 512 revisions served 261,632 references (10.10 MB), and resolving one thread rewrote 511 of them (a 10.11 MB patch). And because a message counted only while its thread still awaited the agent, resolving a thread with no answer took its comment off every revision it had waited across, which then read as made with none waiting. The reading now serves each message's wait instead (`message_waits`, an entry a message): `from`, the newest revision the log named when it was sent, and `until`, where the agent answered it or the user resolved its thread, null while it waits. A revision written in that interval came after it, so a revision's messages are a fact about its past that no later event rewrites, and a gesture sends only the waits it ends. At 512 x 512 the reading's waits are 40,143 bytes, and one resolve sends 1,433 bytes of patch, 106 of them the one wait it ended. A resolution names no revision, so the wait it ends runs to the newest revision the log names next after it: a revision the log can't place before or after a resolution counts as before it, since "after your comment" stays true of it either way. 4 of the 216 waits in this month's page logs were ended that way with such revisions beside them. That also changes which messages a revision names: every message waiting when it was written, rather than those the agent answered first after it. On the same 39 pages with pickups (1,885 revisions), revisions with one anchored comment waiting changed that comment's element in 71% of 116 cases, against 68% of 130 for the earlier rule and 17% by chance; 4.5% came after several messages (2.7% before) and 83.4% after none. The earlier rule's narrowing needed answers yet to come, which is what made its lines change after the fact. **A change was attributed through its nearest id.** Paragraphs without ids share their section's unit, so a revision that edited one and a revision that edited another both claimed both changes. `madeBy` now narrows each change to the comparison's own blocks: of the revisions that changed its units, the one that wrote each block's words, as `diffBlocks` keys them, and the one that took out each base block it took out. Where several revisions changed a change's units it reads their documents, painted as the page now paints, through the view answer's new `url` for each revision; one revision needs no document. The comparison is read again after the documents arrive, so it still marks the page in one synchronous stretch. A block marked for its state alone, such as a pick, is now made by no revision. **Checks.** The provenance model tests (waits, a resolve sending one wait, the units), the runtime test for the words, the served-page tests including `test_a_change_names_only_the_revisions_that_wrote_its_own_blocks`, the comparison tests that hold or reroute `/api/view`, the served-schema process test and `pnpm run check` pass.
Round four of the preview owner, from the decisions on round three and what the link, chart and thread branches found converting to its contract. Focus previews read only where the user moved focus themselves: a Tab or Shift+Tab (the runtime's `step`), or a key that moves them between items while it is down and leaves them in the surface they were in, as an arrow, Home or End does in a list or a widget (`aimed`). Focus a surface places as it opens, as the Page Map's first row, a margin card's first control or a thread's name, focus it hands back as it closes, and focus Escape moves as the user backs out, as from a reply box to its thread, preview nothing, so none stands in front of the Escape the user reaches for next. Escape stays the first step of every preview that stands. On the same 65 Escape tests as round three, 9 failed only because of that step; now 2 do, both where the test Tabbed onto a control and pressed Escape, which is the 1.4.13 cost, and both now press it (test_command_routes, test_escape_from_a_seated_reply_send_returns_to_its_thread). One of the two is in the random draw of 48: about one Escape journey in fifty (Wilson 95% interval 1 in 270 to 1 in 9), where it was one in seven. The 9 that fail with the step off fail on 6b3159d too. Previews are hoverable (WCAG 1.4.13): a pointer's preview takes the pointer, so the pointer can cross from its target onto it and read it there; leaving it puts it away after the dwell, and reaching another target from it shows that one at once. A focus's and a finger's take none. One placement rule for every preview (`stand`, preview.js), measured as it shows and written as insets from the box that carries the target through a scroll (`carrier`): the nearest that scrolls, stands fixed or sticky, or stands in the top layer, else the page's root, each named once. Naming the target wrote its style, which the margin's observer heard: on a page of 512 threads, the first preview on each paragraph measured the margin's 512 boxes; now the first preview of the session measures them once, as the root takes its name, and each paragraph after measures none. Below the box it previews by the gap that clears a focus ring, above where the window has no room, above first for a finger and for a point inside the target; beside a column of targets, toward the nearer window edge, so a margin entry's covers neither the entries above and below it nor the passage it is about, and below a column too wide to stand beside. Along the line it starts at the box's start edge and stays inside the nearest box around the target wide enough to hold it. That replaces the end-edge alignment, which kept a control at a card's end inside the card but pushed an inline target's preview out of its column: a link early in a line of prose (the gallery's trailhead link stood its card at x 28 against a column starting at 168), an age inside a thread card, and a margin entry's, over its passage. It also replaces the CSS position areas, the fallback list and the two places the preview stood a shadow tree's targets by: each show names no target and adds no rule. A target finds its column by a few hit tests around itself, and a target beside it, as a toolbar's controls stand, makes it a row. The contract keeps its shape and adds: - a standing preview's declaration is called again for each new presentation of the document, a state's or a revision's, after it has painted, never per pointer move, so it follows the page, a link's place or a thread's turn, redrawn in place with no fade and left as it is where its words come back the same; a range's preview included, and a range's owner declaring the same range again gives the standing preview its new words, where the same boundaries used to discard them; - `previewChanged` redraws a standing preview in place without the preview closing itself: ending the old record's watch hid it, as `shown` still named that record, so a chart's tip vanished at every other point; - the innermost target wins on every route: a link inside a thread's passage previews as a link to the pointer too, where the passage's owner reported its range after the link's boundary. Titles: every writer that can later remove or blank its title declares its words as `lfPreview` instead, since a removal can't reach words the preview took: the composer's error line, the panel's mode word, menu rows, choice commits and row notices, a deleted message's edit time, command reference entries, the shot view's link and scale words, the file editor's status, the trace's selection label and caption, and the target picker's search status. Writers that only set or replace a title keep it. The words the preview takes live beside the portable writer (element-markers.js, `titleWords`), where the contribution entries and the interaction log now read them, and a frame's title, its accessible name, stays where it is. The long-press menu stays shut only while a held preview shows, so holding a link to another site keeps the platform's menu. Tests: a standing preview stays open through `previewChanged`, follows a new presentation and a new revision, and a standing range preview says its owner's latest words, each failing without its fix; the innermost target previews under the pointer inside a range's passage; the pointer onto a preview keeps it; tests that read focus previews move focus with a key, as the user does; the preview tests run in both engines.
…e by unit again Review of c3a05cf found that a resolution set no stable cutoff and that a comment could be credited to revisions written before it, and that the browser's document-fetch path for block attribution grew with revision history. The root of the first two: the log had no ordering between revisions and events, so the code inferred it from which revision each event names. A revision a tab's read activated is named by nothing, and a comment from a tab still showing an older revision names that one. **The ordering primitive.** Each revision now records where in the log it went live, the seq of the last event before it, in `revisions/rN-H.json` beside its marker (`revision_artifact.ACTIVATION`, a `state.Record`). Activation runs in a page transaction, which serializes with every append, and the record is written before the marker; a publication's own events, such as the reply that published it, come after that place, and an interrupted publication finished later takes its prerequisite's seq less one. An activation interrupted before its marker leaves a record the next attempt writes over, and a sample's child writes it without an fsync, as it does its bundle. `message_waits` now gives each wait as places in the log: `from`, the message's own seq, and `until`, the seq of the agent's answer or of the user's resolution of its thread. A revision went live while the message waited where its `after` falls in that interval. No later event or revision moves either end, so a resolve's cutoff is fixed, a later comment from an old tab rewrites nothing, and a comment waits only across revisions activated after it. The reading no longer needs the page's newest revision, and the `/api/view` answer carries each revision's `after` in place of its document `url`. **Block attribution.** Measured on the 39 pages with pickups in this month's page logs, comparing each version with the one before it, as `v` does (567 comparisons, 8,411 changed blocks): the nearest-id unit credited 28.5% of changed blocks with a revision that wrote only another surviving block of the unit, but that changed what the label says for 2.2% of blocks, in 10 comparisons. The fetch path ran for 32.5% of blocks and read documents in 98 of the comparisons (mean 0.5, at most 27). Comparing the first version with the newest (34 comparisons, 5,059 blocks), the label changed for 46.3%, and the fetch path read 22 documents on average and up to 189. So the fetch path and its `url` field are reverted, `madeBy` attributes by unit as before, and `provenance.py`'s header states those error rates; a server-side owner for long comparisons waits on a decision. **Checks.** The provenance model tests, including a real page's activation records, a message from an old tab and a reply that publishes; the publication, inspection and revision-delivery model tests; the runtime test for the words; the comparison browser tests; the served-schema process test; and `pnpm run check`. At 512 threads x 512 revisions the reading's waits are 41,059 bytes, and one resolve sends 1,433 bytes of patch, 106 of them the one wait it ended.
A comparison of a version with the one before it (the `v` walk) now carries one line under each change's count, the same for every change: "v4 saved while your comment waited:" with the comment's opening line as it read then, or "v4 saved with none of your comments waiting". A comparison across several versions says nothing of it. Per-change attribution by the nearest element with an id is gone, with `madeBy` and `changeProvenance`: it credited the wrong revision to 28.5% of changed blocks on the versions compared one by one, and to 46.3% across a first-to-newest comparison. `versionProvenance` computes the line once per reading. Waits are read from one history of when each thread stood closed, which `build_threads` now walks in log order: the latest closing (a resolution, or an action winning its coordinate whose answer names the thread) or reopening (an unresolve, a spoken reply, a user's rewrite) still in force decides, and taking one back, outranking or retracting it leaves the one before deciding at that place. `resolved` is the closing standing at the end, so the separate final InForce pass and the five scattered assignments are gone. On the 201 threads of the 144 page logs written under ~/.tmp this month, every field of every thread reads as before. So an undo of a resolve starts a new wait instead of reopening the old one, accepting a suggestion ends a wait as a resolution does, and taking back an accept while the user's own resolution stands keeps the thread closed. A revision's place in the log is the event that names its bundle in `publication`. A reply or note that publishes one already did; a revision a tab's read activates now appends an `activation` event (bookkeeping, skippable, so a Leaf at the same protocol skips it; the protocol baseline accepts it without a bump), which also takes over the first reanchor's role as the publication's prerequisite. On the 39 pages with pickups this month that adds 1,454 events to 3,693. A refused reply or note still appends nothing. The record file of the previous commit is deleted. A place at a wait's end counts, since only the reply or note that ended it can stand there. Re-scored on those 39 pages with the served waits: of 568 versions compared with the one before, 17.6% were saved while one message waited, 8.8% while several did, and 73.6% with none; of the 41 saved while one anchored comment waited and that changed words, 83% changed the commented element, against 25% for every pair of a version and an earlier comment. Tests that changed behavior: a read activation now logs an `activation` (test_responses, test_revendoring, the activity snapshot's seq), and an interrupted read activation leaves the activation, not a reanchor, as what recovery finishes (test_interact_anchors).
…b asks Review of 28f198d found that a later undo rewrote a past version's line, an undone rewrite changing its quote and an undone comment erasing it, and that the served waits grew with each message times each reopening of its thread: 132,353 waits, 15.8 MB, for one thread with 512 follow-up, resolve and reopen cycles. Both came from reading the past from the current threads and serving it expanded. `message_waits` and its field in every browser reading are gone. The comparison's own request, `/api/view`, now names `shown`, the revision the tab compares the base with, and answers `saved_after`: the threads folded by `build_threads` over the log before the version's last revision went live, so nothing written since reaches the answer, and each message that had been sent, was still unanswered and whose thread stood open (its closure history) at the place of any of the version's revisions. It is computed only for that request and kept nowhere. Taking back a rewrite or the comment after the version went live changes nothing it says; taking either back before does. Measured in this process, least of five, on a host at load 4 to 5: the view answer without and with `shown`, the latter comparing a revision activated after the whole log, so the fold reads all of it. leaf-dev scaling threads@1600 (3,202 events) 49.3 ms -> 82.7 ms leaf-dev scaling batch@1600 (1,602 events) 36.0 ms -> 62.8 ms leaf-dev scaling messages@1600 (2,001 events) 22.7 ms -> 38.7 ms leaf-dev scaling events@1600 (1,602 events) 58.3 ms -> 63.7 ms 512 threads waiting across 512 revisions 9.2 ms -> 16.0 ms (v), 22.2 ms (first to newest) one thread, 512 follow-up/resolve cycles 5.5 ms -> 13.5 ms A version one of whose revisions no event places says nothing, where it said none waited: a Leaf at protocol 42 without the activation event activates a read's revision with no event. Checked with this branch and its base writing one page in turn: neither misreads the other. The base reads this branch's `activation` without error, leaves it out of pending and delivery as this branch does, and finishes this branch's interrupted activation from it; this branch reads the base's log as before and now gives the version spanning the base's revision no line. So no protocol bump, and `reanchor.publication`, which a base Leaf still writes as a read's prerequisite, stays. Re-scored on the 39 pages with pickups, with positions inferred as before: 169 of 568 versions compared with the one before have an unplaced revision and say nothing. Of the other 399, 18.5% were saved while one message waited, 8.3% while several did, and 73.2% with none. Of the 21 saved while one anchored comment waited and that changed words (from 9 pages), 15 (71%) changed the commented element; on the same 21 versions, 35% of the 71 pairs of the version and an earlier anchored comment did, or 40% weighting versions equally. 28f198d's message compared 83% with 25% pooled over every version, a baseline from another population; this replaces it.
f2aaf52 quoted a message as it read when the version's last revision went live, so a comment that waited across one of the version's revisions as "Make it blue", was answered, then rewritten to "Make it red" and answered again before the last, was quoted red, a wording that never waited across the version. Each message is now quoted as it read at the latest of the version's revisions it waited at, from the thread's rewrite history the prefix fold already holds (`thread["revisions"]`), with no further fold. Where it waited at two of them in different words, the later wording is quoted: the rewrite restates what the user asked for, and the version's later revisions were made with it waiting. `test_provenance.py` holds both cases. Only the messages the line can quote are read into words now, `provenance.QUOTED` of them, which the browser reads off the answer rather than keeping its own count: reading every waiting message's Markdown was most of the answer's cost where many wait. On `leaf-dev scaling` threads@1600, with a revision activated after the whole log and 1,600 messages waiting, the view answer took 47.1 ms without `shown` and 53.1 ms with it (least of five, host at load 8), where f2aaf52 took 98.5 ms with it at load 5.7; 512 threads across 512 revisions, 9.9 ms compared as `v` does and 14.8 ms first to newest.
…says who moved it Round five of the preview owner, from the review of 00e9ab5. Placement is the browser's again. The preview is shown with its target as its source (`showPopover({source})`), whose box is its implicit anchor (`position-anchor: auto`), and controls.css stands it there with a logical `position-area` and five `position-try-fallbacks`. That deletes `stand`'s insets, the carrier it named and the container clamp. The preview now follows its target through a scroll inside the page and a resize, starts at a right-to-left target's right edge, and writes nothing on the target, its root or a box that scrolls it. So the margin no longer lays out again for a first preview: on the 512-ask scaling page a paragraph's first preview made 3 rect reads, where round four made 22,543, and wrote no style or class outside the preview. A target with no HTML box of its own (a range's line, a declared box, a shape in a drawing) is stood for by the place, a box in the chrome that scrolls with the page. The module still picks the side, by a few hit tests across the room each side offers: below, above, then beside toward the nearer window edge, the first that fits and covers no other target, so in a 2x2 grid the preview covers no neighbour and the pointer reaches the one below. Where every side covers a target, the preview stands below and the pointer passes through it. A preview taller than the room on either side is held to the room below or above, with its face scrolling, through the window's resizes. Inside a modal dialog it stands in the topmost dialog, carrying the chrome's styles into the dialog's shadow tree where it is in one (layer-stack.js, `carryChromeStyles`, which `seatModal` now calls too), so the pointer can cross onto it there. A hint now expands no control: the layer stack set `aria-expanded="true"` on a popover's `source` whatever the popover was, so a preview shown by the Leaf button announced the panel as open, and the button's own render wrote the value back. Two engine gaps shaped it, both in notes/browser-support.md. Firefox 157 stands a popover shown by a new source by its last source while nothing about the popover changed, so a new source that comes with the same words moves the preview to the other side of the place. Chromium 156 tries no sixth fallback, so the list holds five. Titles: this reverses the call that the preview takes over `title`. The preview no longer takes an author's title off its element. A pointer over an element the browser's tooltip speaks for gets that tooltip and no preview; focus and a finger read the title's words in the preview. Removing a title therefore leaves no words behind, and a control named only by its title keeps that name. The takeover, its cache (`takenTitles`, `titled`, `titleWords`, `takeTitle`) and the readers moved onto it go. Leaf's own symbol controls write no title on Leaf (element-markers.js `titlesName`, read by `nameAction` and the symbol and mark roles); off Leaf they still write one. The compose box's alternate Send drops its title, which repeated its face. Leaf's other titles, such as the held-news notice, panel notes and message times, now show the browser's tooltip to a pointer. Focus previews read who moved focus, not which keys are down. A Tab, Shift+Tab or a placement standing in for one (`step`) shows one, as do a keyboard walk landing (`beginWalk`) and a move a Leaf command the user invoked makes in its own run (dispatch.js `commandRunning`), unless that move enters a surface as it opens or is Escape's step backing the user out, as from a reply box to its thread. A script's focus while Shift is down shows nothing, and an `m` walk onto a margin card's message shows that message's preview. A preview the user put away stays away until they aim again: `previewChanged` redraws a standing preview and opens none on focus, so a board grip released after Escape, or a chart redrawing with the same point, no longer revives one. When a preview goes, whatever puts it away, the element that declared it hears `lf-preview-ended` (`PREVIEW_ENDED`, portable-api.js), a `CustomEvent` whose `detail.route` names the route that read it, so a widget takes off a mark it drew for the reading. Tests: a preview writes nothing on the page and brings no margin pass; it covers no grid neighbour and takes the pointer inside a modal dialog; one put away stays away through a widget's redraw, script focus and a grip's release, and the declaring element hears that it ended; a title stays its writer's; and a preview stands by its target through a scroll, a resize and right-to-left text, and is held inside a short window. All run in both engines. Tests that read a focus preview now step onto their target with the keyboard (render_harness.py `tab_onto`); the cluster test drops a script focus that no longer reads as the user's aim. The panel's Done asserts its preview's words instead of a title. The symbol tests check that no title is written on Leaf and that one is written off it.
…comparison answer Review of f2aaf52 and 0a0cf2b found that the version's last revision decided for every earlier one: a comment taken back after r2 went live read as never having waited there, and a rewrite taken back after r2 left the quote in the words before it. And `_open_at` walked every revision for every thread, 331.9 ms at 4,096 of each. `events.build_threads` can't stop between events, since it reads which gestures were ever taken back before its pass. But its histories keep the place of everything they hold, so `provenance.saved_after` now folds the log before the version's last revision once, with nothing taken back, and reads each message's waits from those histories: each turn from its own place until the first of its answer (`events.settlements`), its being taken back, or the message's, cut where its thread stood closed (``closures``). A bisect of the version's sorted places finds the latest it waited at, after one pass over each thread's closings; the words are those of its latest rewrite before that place not taken back by then. The comparison answer, `/api/view`, now carries only what a comparison folds: the base's document projection (`document.browser_document`, now made from a `PageReading`, which gains `floors`) and `saved_after`, in place of a whole browser reading. `PageStateService.page_browser_view` is `page_comparison`, the browser folds the projection through `projectDocument`, and `project_browser_state` loses `include_active_view`, which nothing else set. The change walk's `h` now says the version's line after the walk's position, as the ⇄ entry does. Protocol 42 to 43: a Leaf at 42 skips `activation` and so leaves a read's revision with no place in a log another Leaf at 42 reads (found on this machine, where the installed plugin and checkouts serve the same pages). With the bump `activation` is no longer `skippable`, `reanchor.publication`, which only a Leaf at 42 wrote, is dropped, and the reader's guard for an unplaced revision and its test are deleted. A page taken to 43 keeps its earlier revisions without a place, and they add none to their version. Measured, least of five in this process unless said: saved_after, N threads waiting across N revisions: 512 1.3 ms, 1,024 2.5 ms, 2,048 5.6 ms, 4,096 11.5 ms (first to newest 11.6 ms) /api/view on leaf-dev scaling threads@1600, with a revision activated after the whole log: 5.6 ms without `shown`, 13.2 ms with it (was 47.1 and 53.1 ms) A `v` press to the line, threads@1600, median of seven warm presses with the pointer resting on the entry, host at load 5 to 7: /api/view line in the DOM starts showing fully shown Chromium 34 ms 55 ms 164 ms 247 ms Firefox 29 ms 61 ms 174 ms 257 ms The line is in the DOM within 100 ms in both engines; what follows is the hovered label's 90 ms reveal delay and its fade (controls.css), which this leaves alone. Re-scored on the 39 pages with pickups, with each comment's anchor read from the log before the version went live rather than from the final log: of the 399 versions whose revisions all have a place, 18.5% were saved while one message waited, 8.3% while several did and 73.2% with none. Of the 28 saved while one anchored comment waited and that changed words (9 pages), 18 (64%) changed the commented element, against 42% of the 79 pairs of those versions and an earlier anchored comment, and 42% weighting versions equally.
A preview may declare a list, `list: {items, more}`, as the threads standing at one
place. Where the list is taller than the room the face is held to, the owner shows as
many items as fit and, under them, `more(count)`'s words for the rest, such as "and
26 more threads" (preview.js `fitList`). It fits the list again as the face's box
changes with the window (a `sizeObserver` on the preview). The items it leaves out
stay laid out but `visibility: hidden`, so they are neither seen nor read by a screen
reader, and the face's size, and with it the browser's choice of where the preview
stands, holds. Each place is written once per fit. A list's face clips; every other
preview's face still scrolls. This replaces the `fits` flag the first round-five
commit added and a consumer's own `overflow: clip` rule, so fitting has one owner.
Test: a 30-item list in a 260 px window shows the items that fit and counts the rest,
inside the window, and shows them all with no count once the window is 1400 px tall,
in both engines.
The module reference spelled the count function inside a double-backtick code span, which the export-documentation test reads span by span; the example is now the words it gives.
…oned history Review of 73611c2 found that the historical fold took the current revision's containment: a version that moved a restated option into another group made an earlier comparison forget the comment the restatement had reopened. Containment reaches `events.build_threads` only through what each action rests on (`events.action_rests_on`), so `provenance.saved_after` now reads each of the version's revisions' containment, groups the revisions by what every action in the log rests on under it, and folds once per group, to its last revision, under that containment. A page whose versions move no element an action names takes one fold; a log with no action reads no containment at all. `test_provenance.py` holds the reproduction. Recording each action's resting at admission would let the fold drop the document altogether, but `action_rests_on` holds the rule that moving a named element out of its owner changes what an action rests on, which the current reading keeps; freezing it at admission would change that reading, so it stays a reader's. The filter that left a revision with no place out of its version is gone, as is the fallback it was: every revision a version spans must have a place. On a page renewed from protocol 42, comparing a version that spans a revision the 42 Leaf activated now fails the whole comparison: `/api/view` answers 500 `KeyError: <revision>`, and in Chromium and Firefox the status says "Couldn't load v1" with no marks and no entries. Measured, least of five: `/api/view` with `shown` on leaf-dev scaling threads@1600 10.7 ms (5.3 ms without), events@1600, whose 1,600 actions make it read containment, 30.3 ms (24.5 ms). The prefix-fold oracle from review, rerun with a containment per revision, held on 400 seeds.
# Conflicts: # browser/styles/components/controls.css
With the preview owner merged, a margin entry's label is its preview (runtime/preview.js), and an entry's context is one line of its detail. A change's context holds its account and, under it, what its version was saved after, a line each, split by a line break; the entry's preview (`contribution-controls.js`) now gives each its own line of detail (`voice.linesOf`), as the label's `pre-line` did. The comparison test reads the line from the preview. Measured on leaf-dev scaling threads@1600, median of seven warm `v` presses, host at load 8 to 9: with the pointer resting on the entry through the press, no preview shows, since a press quiets its target until the pointer comes back and a target that arrives under a resting pointer shows nothing (preview.js). With the pointer moved onto the entry as soon as it stands, the preview holding the line opens at 279 ms in Chromium and is fully shown at 378 ms (the owner's 200 ms dwell and 90 ms fade), and opens fully shown at 295 ms in Firefox. `/api/view` answered in 33 and 28 ms. The comparison read now reads a revision of the version shown only where an action rests on its containment, so the transaction test sees only the base read.
…y change, and quote what the thread shows Review of 6d85b84 found three defects. A comparison of a version with many saves read every action under every save's containment, and folded the log once per distinct reading: 1,600 saves alternating an option's owner took 964 ms, and 1,600 saves moving it into a fresh owner 1,599 folds and 4.5 s. Containment reaches the fold only where a version retracts a decision: an action stands until a note restates an element it rests on, and whether it rests on a named element is the document's to say. So `provenance.saved_after` now reads, under each save, only each owner and element it names that a later version restated, from an action made before that version, and reads no containment at all where nothing was restated. Both cases now take one fold: 4.9 ms for 1,600 alternating saves and 5.4 ms for 1,600 fresh owners, least of five; the containment-aware oracle from review held on 400 randomized logs with moves and restatements. A fold per save remains where a version's saves move a restated element through owners earlier decisions named, each save another: 800 such saves took 1.7 s. Removing that needs the fold itself to take containment as it changes, re-judging the decisions resting on what moved, in `events.InForce`; it is not built. A change whose comparison kept no earlier words, as a restated choice's, opens no card, and its ⇄ entry then said nothing of what the version was saved after, though `h` did. The line is the comparison's reading, so `annotation-inventory.js` now gives it to every change, under the account where the change has a card. The quote rendered only the message's first source line, so a comment opening with a code fence quoted nothing and a reference link its syntax. `passages.message_opening` now reads the whole message in the message dialect the thread renders it in, as the DOM reads its text, and takes the first line that holds words; a code block's first line is its own.
… shows Review of 121f260 found the line wrong where a choice and a creation name the same element, its cost growing with saves times an action's options, and its quote diverging from the thread for a fence with words on its opening line and for a suggestion. The first two came from `provenance.saved_after` keeping its own table of which earlier decisions still stand under each save's containment, beside `events.InForce`. That table kept one action per owner and element, so a creation, which rests on the element it made whatever holds it, stood for a choice, which rests on it only while its owner does. `InForce` now keeps a retracted action, with how many restated elements it rests on, and takes containment as it changes (`contain`): an owner gaining or losing a restated element it names moves only the actions that name it, and the state after is the one a walk under that containment from the start reaches. `build_threads` takes each revision's containment where it takes hold (`containments`), and `saved_after` folds once and reads the closure history, with no table and no grouping. A containment is read only where some action names a restated element. Measured, least of three or five, this process, before and after: one save, 1 multi-select action naming 400/800/1,600 options: 7.7/31.9/124.3 ms -> 0.26/0.56/1.31 ms n single choices of n options, n saves (100/200/400): 4.5/24.1/77.9 ms -> 0.36/0.69/1.55 ms one multi-select action of n options, n saves (50/100/200): 7.1/57.2/391.2 ms -> 0.07/0.14/0.26 ms a restated option moving into a fresh owner each save, each owner holding one earlier choice of it (100-1,600 saves; before at 100-800 per review): 34.5/142.4/598.1/2,227 ms -> 0.5/0.9/1.9/3.9/8.8 ms One case stays quadratic: a restated option alternating between two owners each save, with n earlier choices of it split between them, re-judges every choice at every save: 3.6/14.4/63.4/261.8/1,159 ms for 100-1,600, where the table took 0.7-13.1 ms by merging what it got wrong for creations. Re-judging the choices that rest on one owner and element together, as one group, would make it linear. The reviewer's containment oracle, extended with creations, is now a test: random logs of comments, replies, answers, resolutions, rewrites, undos, choices, created options and restatements, over versions that move, drop and bring back options, read against a fold of the log up to each revision under its containment. Its 400-seed run held, and the creation collision is a test of its own, which fails on the table. The quote was Python's second reading of a message's visible words, missing the browser's `fence_words` rule and reading a suggestion as Markdown. The server now names, for each waiting message, the event whose words then stood (`said`): the message, or the rewrite of it standing at the latest revision it waited at. The browser quotes that event's words as the thread shows a message (`thread/messages.js`, `messageText`), so a fence opening with words quotes both its lines and a suggestion its stars; `passages.message_opening` and the server's `QUOTED` are gone, and how many to quote is the browser's again. `test_provenance.py` copies the shared model registry before adding to it, as `model_layer` asks; its earlier in-place change had made admission tests fail when run in the same worker.
…any turns on it After 411866d one case stayed quadratic: a restated option alternating between two owners each save, with n earlier choices of it split between them. `InForce` kept a count per action, so every save re-judged every earlier choice. `InForce` now keeps the actions at a coordinate that rest on the same elements as one family (`events._Family`). A version restating an element the family rests on retracts each of its actions made on an earlier version, so whether one stands turns on one threshold, the latest such version, and a note or a containment moves that threshold once for the whole family. A family finds its latest action at or after its threshold in a max tree over its actions' revisions (`_Latest`), and a coordinate's winner is the latest of its families' current actions, so one family of many actions, or one coordinate of many families, costs the logarithm of its size per step. Membership is fixed when an action is admitted, so nothing regroups. The walk also judged under a stale containment. `contain` skipped reading a containment while no decision turned on one, and kept the one before; a note that later made a decision turn on it judged under that older containment until the next revision's containment took hold. `contain` now keeps the reader, and the first step that asks what an owner holds reads it. Provenance read the same lines either way, since it reads only at revisions, where the next containment had corrected the walk; `thread_memberships` and the projection never hand one over. A new test walks `InForce` through random actions, undos, notes and containments and checks, at every step, each winner, the actions in force and the changes reported against `action_retracted` from scratch. It fails at 411866d, and on this tree with the lazy reading undone, at the same step. Measured in this process, 411866d then this tree. The alternating case is least of three; the others are least of nine, the two interleaved: a restated option alternating between two owners (100-1,600 saves): 3.6/14.0/57.2/242.7/1,069 ms -> 0.5/1.0/2.1/4.6/9.7 ms n single choices of n options, n saves (100/200/400): 0.35/0.69/1.48 ms -> 0.36/0.79/1.58 ms one multi-select action of n options, n saves (50/100/200): 0.069/0.133/0.257 ms -> 0.075/0.143/0.275 ms one save, 1 multi-select action naming 400/800/1,600 options: 0.26/0.52/1.08 ms -> 0.29/0.57/1.27 ms a restated option moving into a fresh owner each save (400/1,600 saves): 1.8/7.8 ms -> 2.1/9.2 ms The four linear cases keep their growth and cost 3-18% more, for the families' trees and heaps.
`InForce.contain` compared what owners hold of every restated element some family names, at every containment, so a walk over a version's revisions cost those elements times the revisions: 1,081 ms for 6,400 restated options and 6,400 containments, and 898 us per containment at 25,600 options however little moved. The reader of each revision's containment now says which elements' holders it moved since the one before: `SourceReading.moved_since` compares two containments once (`passages.moved_ids`) and holds the answer beside the later reading, so a stored revision, whose reading the server holds across requests, pays the page-sized comparison once per pair of revisions. `saved_after` takes the revision reader itself (`read.revision`), and hands `build_threads` each revision's containment with a reader of what it moved since the one before it, none for the first. `InForce.contain` compares only the restated elements among those. A containment read late, after none turned on it, is compared against the one handed over before it, as before. No other reader compares consecutive containments. The walk test now hands most containments over with what moved, and a few without, and fails where the delta is empty or taken from the containment two back. Measured, 9daa9fa then this tree, this process: InForce, 6,400 restated options, 6,400 containments each moving two: 1,081 ms -> 11.5 ms (1,600: 71.3 -> 2.6 ms) InForce, per containment, two options moving, 400/1,600/6,400/25,600 restated: 13.9/51.2/205.8/898 us -> 1.6/1.6/1.7/1.8 us a served comparison read across 100 unstamped revisions, each moving one of P restated options (`PageStateService.page_comparison`), P = 400/1,600: revisions held, as a server holds them: 2.86/11.47 ms -> 0.91/3.01 ms first read: 359/1,408 ms -> 373/1,507 ms The first read is building each revision's containment, page-sized per revision: 3.4 ms at 400 options and 14.2 ms at 1,600, a hundred times. The comparison that names what moved adds less than a millisecond per revision to it. On the largest pages `leaf-dev scaling` generates, every server axis at 1,600, a served comparison read takes the same before and after (cards: 147.4 -> 145.7 ms with a shown revision; options: 1.7 -> 1.7 ms), since each compares one revision with the one before and no action there names a restated element, so no containment is read.
…ote the whole message Review of 121f260..26d4f4a found four costs and gaps. Choices naming [x, a], [x, b] and so on each made a family of their own, since a family was keyed by everything its actions named. Restating x and moving it between owners then revisited every family at every move: warm `saved_after` took 1,207 ms at 1,600 choices and saves. A family is now keyed by what its actions name that a version has restated (`events._Family`), reached through a trie in the order versions first restated each element (`_Node`), so one set is one family however its actions reached it. What no version has restated yet decides nothing, so choices naming x and options of their own share one family until a version restates one of those options; then the actions naming it move to the family that names it too, the fewer of the two parts moving (`InForce._regroup`). A containment compared each restated element's two chains of holders by searching both for every ancestor, quadratic in depth. It now finds the owners that gained or lost the element once per element, and reads only those some family watches. The line's quote read a message from the log with its words alone, so a message holding a widget quoted its prose ("Choose:") and an image-only comment quoted "". It now reads the message from its thread, as the thread reads it: `thread/messages.js`'s `messageWords`, which `threadName` also reads, counts a widget's words through the message's captured body and an image by its alt text, else Image, as its control is named. An image-only comment quotes "Attached image". A message's words at an earlier save come from the thread's rewrites, which the published thread record now carries. The line also indexed the whole log at every presentation, with or without a comparison, and subscribed the ⇄ entry's label to every accepted log change. It now reads nothing while no comparison shows, and while one does, only the threads of the messages it quotes, through the thread index (`thread/state.js`, `threadNamed`). `h` landing on a change whose block a waiting comment stands on opens that comment's thread over the margin at main's merge base as well (6b3159d): the same card at the same place, so this branch doesn't cause it. Tests, each failing on 26d4f4a: moving a restated element judges as often whether 10 or 100 choices share it (300 against 3,000 judgments); a containment wrapping every option once more reads chains in proportion to their depth (554,400 reads at depth 80 against 43,200 at 20, before); a waiting message holding a widget quotes its words; an image-only comment quotes "Attached image" on a served page, in Chromium and Firefox; with no comparison the line reads nothing of the log. Measured, 26d4f4a then this tree, this process: review #2, 1,600 choices of [x, o_i], x restated, moved each save, warm saved_after: 100/400/1,600: 4.6/70.1/1,206.9 ms -> 0.6/2.2/9.6 ms one move of x, 10/100/1,000/10,000 choices sharing it: 5.2/46.5/499.4/6,285.8 us -> 1.3/1.3/1.4/1.7 us review #5, 1,600 restated options under 10/40/80/160 wrappers, an outer wrapper added and dropped, per containment: 2.49/18.70/65.63/211.86 ms -> 1.25/3.44/7.12/12.23 ms review #7, the line read with no comparison, 100,000/400,000 events: 3.91/25.14 ms -> 0.000/0.000 ms per presentation The earlier growth cases keep their growth; those whose versions restate an element for the first time across many actions pay for moving them between families: n single choices of n options, n saves (100/200/400): 0.38/0.82/1.74 ms -> 0.79/1.46/2.92 ms one multi-select action of n options, n saves (50/100/200): 0.089/0.162/0.311 ms -> 0.112/0.227/0.475 ms one save, 1 multi-select action naming 400/800/1,600 options: 0.31/0.59/1.38 ms -> 0.60/1.11/2.25 ms a restated option moving into a fresh owner each save (100-1,600): 0.5/1.1/2.3/4.8/10.8 ms -> 0.6/1.3/2.7/6.2/11.9 ms a restated option alternating between two owners (100-1,600): 0.5/1.1/2.3/4.8/10.2 ms -> 0.6/1.2/2.5/5.2/11.0 ms InForce, 6,400 restated options and containments each moving two: 14.5 ms; per containment at 400-25,600 options: 1.7-1.9 us
…members Review of 2d92121 found the line quoting from today's threads, and three walk costs and a stale watcher that grow faster than the page. The browser read a waiting message from its thread as it reads now, so a comment taken back after the version went live quoted "", a rewrite taken back lost its words, and a kept placeholder quoted "Deleted message", though the server named the right message. The comparison answer now carries, with each message, the words it had where it waited (`saved_after`: `said`'s `text`, and whether the message is a `suggestion` or `drawn`), and the browser reads them as a thread reads a whole message (`messageWords`), so it reads no thread at all: marking an unrelated thread read no longer reruns the line or rebuilds the thread index (review #7's remainder). A user's message carries no markup, since the browser's door refuses it, so a message's words are all it holds. The published thread record no longer carries the rewrites the last round added for this. A split partitioned every slot its family had ever held, taken-back choices included: with 64,000 undone choices and 252 splits it took 62.6 ms. Each family now keeps its live members in log order, and a split partitions those (16.1 ms, flat in the undone). A containment found each element's changed owners once, but each family it moved asked the chain again for its threshold, N families times an N-deep chain: 203.6 ms at 6,400 ancestors. The walk now reads each element's holders as a set once per containment (`_Holders`), which `_holds` reads as it reads a containment (6.0 ms). A family whose last action was taken back kept watching its elements, so with 6,400 such families each move of an element cost 2.3 ms. A family is dropped when it empties, and its node takes a new one if an action returns (0.0 ms). Tests, each failing on 2d92121: a comment taken back after the version went live is quoted in its words, on a served page and in the answer; a split reads as much after 10 undone choices as after 100; moving a restated element out of an owner at every depth of its chain reads holders in proportion to the depth; once every choice is taken back, moving the element judges nothing. Measured, 2d92121 then this tree, this process, least of three: splits, 252 of them after 1,000/16,000/64,000 undone choices: 16.8/27.8/62.6 ms -> 16.2/16.4/16.1 ms x chosen at every depth of a 400/1,600/6,400-deep chain, moved out, one containment: 1.03/12.55/203.63 ms -> 0.29/1.26/6.01 ms 400/1,600/6,400 empty families naming x, per move of x: 0.12/0.52/2.30 ms -> 0.00/0.00/0.00 ms review #2's shared x, warm saved_after at 1,600: 9.5 ms; per move 1.4-1.6 us review #5's wrappers at depth 160: 12.7 ms per containment The growth cases keep their growth, within 16% of 2d92121: n single choices of n options, n saves (100/200/400): 0.72/1.34/2.80 ms -> 0.67/1.40/2.84 ms one multi-select of n options, n saves (50/100/200): 0.106/0.209/0.449 ms -> 0.118/0.229/0.494 ms one save, one multi-select naming 400/800/1,600 options: 0.53/0.98/2.12 ms -> 0.61/1.16/2.47 ms fresh owner each save, 1,600: 11.7 -> 12.0 ms alternating owners, 1,600: 10.5 -> 11.2 ms
…acts Review of e3943d7 found a comment deleted by a rewrite to no words quoted as "", in the ⇄ preview and through `h`, where its thread reads "Deleted message". `provenance.saved_after` chose the words of a waiting message itself and sent them alone, without the rewrite that left none, which is how a thread knows a message is deleted. It was a second reading of what a message said at a point in the log, beside the one `build_threads` makes. A message as its thread held it at a place in the log is now read in one home, `EventFacts.message_at`: taken back, if it was by then, else as sent with each rewrite made before that place and not taken back by then applied as the fold applies it (`events.rewritten`, which `build_threads` now calls too). The comparison answer sends each waiting message whole, as `message`, beside its `thread`, and the browser reads it as a thread reads a message (`messageWords`), its deletion, suggestion and drawing included. `saved_after` takes the page's `EventFacts` in place of the log and keeps no selection of its own; `said`, `text`, `suggestion` and `drawn` are gone from the answer, and the edit and withdrawal shapes the served message and the answer share are `MessageEdited` and `MessageWithdrawn`. A test, failing on e3943d7 in Chromium and Firefox: a comment deleted by a rewrite to no words while a version was saved is quoted "Deleted message". The answer keeps the deletion though the user takes it back later. The provenance oracle now compares each message sent with the message its thread held in a fold of the log up to each revision, field for field.
A delivered rewrite's `was`, the words it replaced, came from a fold of the whole log as it reads now (`EventFacts._revisions`), so taking back an earlier rewrite changed it: comment A, rewrite to B, rewrite to C, take B back, and C was delivered as having replaced A. It now reads the message as it stood when the user made the rewrite (`EventFacts.message_at`), which gives B, and `_revisions` is gone. A user's rewrite of a message not taken back by then carries `was` whether or not it was taken back since, since what it replaced doesn't change. No other fact about a message at a past point folds the current log: thread titles, admission and the delivered threads read threads as they are now, as they mean to. A test, failing on 1d3e6ff: that rewrite is delivered with B as the words it replaced.
The branch had merged dcb34de, an early head of the preview-owner work that later landed reworked in #5614 and #5618. A merge from the old base (6b3159d) would keep lines that round added and a later round removed. So this merge replays the branch's own change since dcb34de (its first-parent change-attribution commits, the three early ones thread previews carried and dropped included) onto main: the tree is `git merge-tree --merge-base dcb34de origin/main 7d282ed`, recorded with main as the second parent. Two conflicts, both import lists: change-walk.js takes main's `selectedBase` and comment beside the branch's provenance imports, and test_changes_in_place.py imports main's `told` beside the branch's `example_media` and `preview_parts`. The changed lines of `git diff origin/main` match those of `git diff dcb34de 7d282ed` apart from those two import lines. Main is still at protocol 42, so the branch's 43 stands; `pnpm run build:browser` leaves the baseline and every vendor bundle as merged.
On main the preview owner holds a preview clear of the margin's other entries and cuts what doesn't fit (preview.js, `fit`). In test_a_version_says_which_comments_it_was_saved_after the answered comment's entry, on the paragraph two below the title, left the title's ⇄ preview 54 px, so its last line, the quote of the comment that waited, was hidden. The answered comment now stands on the last paragraph; the test still holds that a comment answered before the version, wherever it stands, is not named.
`/api/view` answers `{document, saved_after}` since 73611c2, but
`leaf-dev verify-site` still required a `browser` object in it, at the
activation read and the cross-tab activation, and so would fail every
site verification; test_a_website_example_uses_the_real_page_server
read the old `browser.views` basis and obligations. Both now read
`document`, as test_site.py and test_interact_server.py already did.
…rites nothing A read's activation appended an `activation` event for every revision it took live, the first included. A comparison reads only the places of the revisions after its base (`provenance.saved_after`), so the first revision's place was never read, yet a fresh page, a sample child and a visitor's first read of a published website page each wrote it to the log, and twelve process tests that hold those logs empty failed. Now a read appends `activation` only where a revision was live before the one it activates (`revisioning.py`'s header states the rule), and those logs stay as on main. Behaviour that changed: a page's first read appends nothing to its log again. test_responses.py and the test_activity snapshot go back to main's expectations. In test_samples_use_captured_resources_and_independent_event_logs the parent changes its module after publishing, and the child's interaction, recorded in the parent's trace, takes that change live as the parent's second revision, which now appends an `activation` to the parent's log; the test reads the parent's log after that, just before the child's comment it checks stays out of it. provenance.py's header said revisions an earlier Leaf activated add nothing to their version; since d0fba96 a comparison whose version spans one fails, and the header now says so.
On review-a-plan, after `v`, Tab onto the table's ⇄ entry showed "v3 saved while your comment waited:" with the quote cut, in Chromium and Firefox. The owner's reading of that decision: every line was there at the first decision (a focus route, 83 px tall), so no late attribution kept a corner. From the entry's left edge the 320 px preview crosses the window's right edge by 14 px, so below, above and beside from that edge were not candidates; from its right edge, beside it and centred it would cover the cell it is about; above, the window's top leaves 64 px. So it stood above, three lines, the quote hidden, though the margin below the entry was free. `stand` now also tries, after every place that keeps to the box's edges, the below and above places the window cut at the box's start or end edge, slid in until the window holds them and still across the box. A preview some place already held whole stands where it did; one that was cut or covering takes a slid place where that holds more. Across the margin entries of review-a-plan, ship-review, log-retention, pr-walkthrough and code-comparison, hovered with and without a comparison in Chromium and Firefox (28 previews each), two moved per engine: review-a-plan's ⇄ entries 2 and 7 of 7, which no place held clear of their passage and so covered it (`data-lf-covers`), now stand in the margin below the entry, whole and clear. test_a_preview_the_window_cuts_at_an_edge_slides_in_rather_than_cut_lines holds it in both engines; it fails before this change. The attribution test keeps its answered comment on `d`: on `c`, its reviewed place, the answered comment's entry stands 65 px under the title's ⇄ with the waiting comment's entry just above, so no place holds the 69 px preview clear of both and the owner cuts the quote, as it cuts any preview no place holds whole (test_a_preview_no_side_holds_whole_takes_the_side_that_holds_most_lines_clear).
leaf-agent
left a comment
There was a problem hiding this comment.
The per-revision containment replay costs more than it buys. To support saved_after, the PR rewrites InForce around _Family, _Node, _Latest, _Holders, _regroup and contain(), about 450 of the 711 lines added to events.py. The only caller that hands build_threads any containments is provenance.saved_after. Every other InForce reader still pays for the new structure: the projection fold, thread_context, gesture_words, and build_threads on each admission in event_contracts. Before this PR, a retracted action could be dropped for good. Now it has to be kept, grouped by the restated elements it names and re-judged, because a later containment might bring it back. Only a containment change inside the walk makes that possible.
The replay only matters in a narrow case. Between two revisions of one version, a containment change has to move an element some note restated into or out of the owner of an action, and that action has to be what closes a thread the user was waiting on. The line this feeds also calls itself an order, not a cause, and the header measures it as an association on 28 versions. A one-version miss in that case is a small loss in a reading that already makes no causal claim.
A cheaper change keeps the feature. Fold the prefix once under a single containment, such as the within of the shown revision, which build_threads(events, within) already accepts. Keep _ClosureHistory, settlements and message_at, and leave InForce with its previous index. If the exact replay is meant to be part of the guarantee, could the PR description or the provenance.py header say which case needs it and why one containment isn't enough? Right now neither the header nor the description shows that.
The focused model tests (test_provenance.py, test_thread_resolution.py, test_interact_anchors.py) pass on the merged tree.
…unit CI's Firefox run read the slid face's right edge at 1192.0000305 against the window's 1192: the owner writes its offsets in 64ths of a pixel (`keeps.layoutPx`) and Firefox lays boxes out in 60ths, so the edge can land a fraction of a layout unit past where it was written. Nothing shows past the window; the test now allows that fraction rather than the owner rounding its faces to whole pixels for it.
…nForce back main's index `provenance.saved_after` folded the log before a version went live with each of its revisions' containment taking hold at its place (`InForce.contain`). Containment decides only whether an action rests on an element it names for its owner to hold, so the replay changed the line only where an element some version restated moved between owners within one version, and a choice naming it settled a thread the user was waiting on. For that, `InForce` kept every action a version took back, grouped by the restated elements it named (`_Family`, `_Node`, `_Latest`, `_Holders`, `_regroup`), and every reader of the log paid for it: the projection fold, `thread_context`, `gesture_words`, and `build_threads` on each admission. The fold now reads the whole prefix under the shown revision's containment, which `build_threads(events, within)` already takes. `_ClosureHistory`, `settlements` and `EventFacts.message_at` stay; `InForce` and `action_rests_on` are main's again, and `build_threads` walks them in log order. Gone with the replay: `build_threads`' `containments`, `SourceReading.moved_since` and `passages.moved_ids`, the five test_thread_resolution tests of the family index, and test_a_choice_stays_conditional_beside_a_creation_of_the_same_option, whose case is the one now accepted. provenance.py's header says what the fold accepts missing and why. Behaviour that changed: in that case the line can name one message too many or too few for the version. `/api/view` with `shown` now reads the shown revision for its containment (test_comparison_revision_reads_stay_inside_the_page_transaction expects both revisions read, as on main). The random oracle in test_provenance.py folds each place under the shown revision's containment. events.py's diff against main goes from +710/-114 to +184/-45.
572d8e4 added the slid places after every other, carrying only their side (below or above, left or right). A new aim rebuilds its side's place from that identity (`stand`, `placement(was.side.y, was.side.x)`), so it rebuilt the unslid place, found the window cut it, and chose afresh: in a 900x700 window a point's preview slid in below jumped above as the aim moved 10 px down, and back below as it moved back, in Chromium and Firefox, though below still held it whole. Now `leftOf` slides each place by the box's start or end edge in along that edge until the window holds it, still across the box, as Floating UI's flip and shift compose: a side builds the same place from the same geometry wherever it is asked, and no pass after the others is needed. test_a_preview_slid_in_keeps_its_side_as_the_aim_moves holds it in both engines and fails on 296b0a5; it rides the preview along the aim, which the shift sensor reports as a move without input, so it is unsurveyed as widgets/test_charts.py is. Behaviour that changed against main: a margin entry's preview near the window's right edge used to stand by the entry's right edge, over the page beside the passage, wherever its left edge crossed the window; it now stands by its left edge slid in, in the margin, covering no page words. Hovering every margin entry of review-a-plan, ship-review, log-retention, pr-walkthrough and code-comparison, with and without `v`, in Chromium and Firefox (56 previews): 20 thread previews moved so, 16 change previews differ only by the attribution's lines, 20 stayed put, and none is newly cut or covering.
provenance.py's header named one case the fold gets wrong: a restated
element moving between owners within a version, beside a choice that settled
a thread. Codex's round-3 review found two more from the same cause: a later
non-answer choice superseding the answer, whose option is restated and moved,
drops a message that waited; and a message can be quoted in an earlier
wording ("Make it blue" for "Make it red"). The header now states the
mechanism: within one version, a containment change involving a restated
element can change which actions stand at an earlier revision's place, so the
line can name a message too many or too few, or quote one in the words it had
at another of the version's places. No code changes.
…r restart journey (#5779) Since #5716, `test_init_restarts_a_served_page_onto_the_replacement_contract` fails in both of its cases (`[session]` and `[persistent]`) on Linux and macOS. In scheduled run [42604289041](https://github.com/max-sixty/leaf/actions/runs/42604289041) it failed with `assert ['note', 'comment', 'activation'] == ['note', 'comment']`. #5716 added the `activation` event, which a page read appends when it activates a revision that no reply or note names. Re-vendoring a served page onto a new layer makes such a revision, so the replacement server's first read writes one. #5716 updated the model test for the same case (`test_revendoring_serializes_with_a_worker_report_entering_the_log` expects `["report", "activation"]`). It missed this journey, which runs only nightly. The journey now expects the activation for revision 2, after the one comment. It still checks that the retried comment wasn't taken twice. The test's coverage of the restart itself is unchanged: the URL, lifetime, claim and revision contract carry over. Both cases fail on main `28c3b37f3` with `--run-nightly` and pass with this change. Refs #4225 — automated triage Co-authored-by: leaf-agent <[email protected]>
…ecord why each message was forked, and add leaf-dev timeline (#5796) Forks went silent on long-lived Claude Code sessions after a protocol bump, and nothing recorded why. This adds the diagnostics and the tool that found it, and the fix. **The bug.** On 8 Nov the leaf-issue-triage session's pages follower had run since 4 Nov at protocol 41. Its checkout moved past two bumps (#5445, #5716), and the session's hooks ran the newer Leaf, which reads a fork lane written at an older protocol as down. So the old follower held messages and asked for forks, the fork step said "not held" and made none, and each message waited out the 30 s hold with no working line. One waited 64 s while the session sat in a 70 s foreground poll, the case forks exist for. **The fix.** The pages follower (`hooks.cmd_pages`) now exits with `EX_TEMPFAIL` (75) once the session's hooks would run another Leaf than its own: another installed copy, another selected checkout, its own checkout moved past a protocol bump, or its own install removed. The hooks module (`hooks/claude-code.ts`) starts it again on exit 75, under that Leaf. Verified live: changing the protocol on disk and back replaced a running session's follower each time, and the next comment got its line at 3.1 s. **Diagnostics.** Each page's observations now record `fork_hold` at admission (held or not, and whether the session's fork lane was up) and `fork_asked` when Leaf gives the module the fork's question, beside the existing `fork_reply` outcomes. When the module's own fork step fails, it now tells Leaf, which hands the message over at once and records the error instead of a silent 30 s wait. **`leaf-dev timeline PAGE [--message ID]`** merges a page's log and diagnostics, each Claude Code session's transcript (turns, the context Leaf's hooks carried in, `leaf` commands, subagents) and Claude Code's debug log into one time-ordered story, with a summary line per message: held or not and why, the fork's outcome and time, first words, pickup and what the session was doing, answer. The Claude Code journey now keeps the session's transcript in its evidence, so the tool reads a journey run as it reads a live page. `TODO.md` also gains a challenge Max asked for: streaming the agent's reply into its thread through one general interface. Tests: `tests/model/test_forks.py` (the diagnostics; the follower ending for each kind of Leaf change), `tests/process/test_interact_claude_code_module.py` (a follower that exits 75 starts again), `dev/tests/model/test_response_times.py`. Live: `leaf-dev journey claude-code --forks --case working`, and real pages from 6 to 9 Nov. > _This was written by Claude Code on behalf of max-sixty_
When the user compares a version with the one before it (
v, or Compare in Versions against the previous version), each ⇄ change entry's preview says, under what the change did, which of the user's messages were waiting when that version was saved: a heading in Leaf's voice ("v3 saved while your comment waited:", or "Draft saved with none of your comments waiting"), then up to three quotes, each as its thread held it then, so a comment rewritten, deleted or taken back since still reads as it did, and past three how many more. Thehchange walk says the same line to a listener. A comparison across several versions says nothing.The line is one per version because the log backs an order, not a cause: a version's revisions went live while those messages waited. The earlier per-paragraph label tried to say which revision wrote each changed block, by the nearest element with an id, and so named comments that had only written a neighbouring paragraph: 2.2% of changed paragraphs between adjacent versions, and 46% between the first version and the newest. Comparing a version with the one before it puts every marked change inside that one version, so a line per version claims only what the log holds, and across several versions nothing holds, so the line is left out.
Which messages waited comes from one fold of the log before the version's last revision went live, read under that revision's containment, which keeps each thread's closings and each message's turns at their places in the log. That is an approximation: containment decides whether an action rests on an element it names, so where, within one version, an element some version restated moves into or out of an action's owner, the actions standing at an earlier revision's place can differ from those its own containment gives, and the line can name a message too many or too few, or quote one in the words it had at another of the version's places. Replaying each revision's containment would cover it, at the cost of a second index of every action in force that every reader of the log pays for;
provenance.py's header records the trade.Placing a revision in the log needs an event that names its bundle. A reply or note that publishes a revision names it in
publication, but a revision a page read activates, as when the agent saves the source directly, had nothing naming it except sometimes its firstreanchor. Protocol 43 adds anactivationbookkeeping event (author: page, withrevisionandpublication) that such a read appends before the reanchors it causes, and dropspublicationfromreanchor. A page's first revision appends none, since a comparison reads only the places of revisions after its base, so a fresh page, a sample and a visitor's first read of a published page write nothing to the log, as before. A Leaf at 42 would refuse the new kind in the log, so this bumps$events.protocolto 43. Revisions an earlier Leaf activated keep no place, and a comparison whose version spans one fails rather than guess./api/viewnow answers{document, saved_after}, and computessaved_afteronly when the tab names the version it shows.The attribution makes a ⇄ preview taller, and on review-a-plan the preview owner cut its quote: from the entry's left edge the preview crossed the window's right edge, and every other place covered the passage the entry is about or met the window's top.
preview.jsstandnow builds each place below or above a target's start or end edge slid in along that edge until the window holds it, still across the target, as Floating UI's shift does, so a side rebuilds the same place as the aim moves. That also moves a margin entry's preview near the window's right edge from over the page, by the entry's right edge, into the margin, covering no page words: hovering every margin entry of five examples in Chromium and Firefox, 20 of 56 previews (all thread previews) moved so, 16 change previews differ only by the attribution's lines, and none is newly cut or covering.Key files:
src/leaf/provenance.py(each revision's place andsaved_after; its header records how the rule was measured),src/leaf/revisioning.py(theactivationevent),src/leaf/events.py(build_threadswalking the log in order to keep each thread's closings, andsettlements),src/leaf/event_facts.py(message_at, a message as its thread held it at a place),src/leaf/served_state/service.py(page_comparison), and in the browserruntime/change-provenance.js(the words),runtime/version.jsandruntime/annotation-inventory.js(fetching it with the comparison base and drawing it under each change) andruntime/change-walk.js(the announcement). Tests:tests/model/test_provenance.py,tests/runtime/change-provenance.test.mjsand the attribution tests intests/browser/startup/test_changes_in_place.py.