Repository navigation
Reuse completed revision-history readings across retries and edits - #2383
Merged
Merged
Conversation
Long histories exceeded the parsed-source budget and repeatedly reparsed completed revisions during state reads and source checks. Retain bounded compact authored facts separately, and reuse canonical historical Question results keyed by their event basis. Preserve existing Question and data-binding behavior across retries, new revisions, Undo and captured sample scopes.
leaf-agent
previously approved these changes
Oct 11, 2026
A collapsed diff can finish its lazy source render after the mechanical loop has already become quiet. Include registered finite preparation in the canonical rendering reading, retiring holds on removal and restoring every still-capable producer on reconnect. Keep failure reporting prompt while waiting for all sibling work to finish; superseded producers can still commit DOM. Reproduced with a held Markdown grammar request that made the old readiness reading report complete before source arrival. Preserve the stability watcher. Cover failed siblings, superseded batches, reconnection, detached registration, and intentional semantic deferral.
leaf-agent
approved these changes
Oct 11, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 11, 2026
Use the existing queued-work lifecycle to retain cause across native awaits. Keep current application proof separate from counted loop quiet, replacing the global preparation gate introduced in #2383. Held mouse, touch and keyboard cases distinguish owned commits from passive work even after newer input.
leaf-agent
added a commit
that referenced
this pull request
Oct 12, 2026
The [deployment failure on main](https://github.com/max-sixty/leaf/actions/runs/38191563247) followed the hosted agent's published revision but read the page before that revision finished presenting. The agent published revision 2 and replied; the journey then saw the new revision marker with the old visible words. The same diagnostic occurred in the [earlier failed deployment](https://github.com/max-sixty/leaf/actions/runs/38135253146). An in-place revision can advance the meta tag while the document patch and widget presentation are pending. The site journey now waits for Leaf's current presentation reading as well as the revision number before checking the rendered page. If presentation never finishes, the timeout reports that missing step. The requirement that the agent's words appear on the page remains intact. The failure surfaced after #2383; its revision-history optimization remains intact. A browser test holds presentation behind an advanced revision marker, then finishes it and checks both readings. The three focused site journey tests and `node --check dev/leaf_dev/verify_site_browser.js` pass locally. This branch includes main at 75515cd so CI can run past the lint failure that blocked its earlier check. The first refreshed CI attempt collected extra `unchanged write` diagnostics in an unrelated thread-list test. That test passed in isolation on both this head and the main commit merged into it, and the full CI rerun passed on the same PR head. --------- Co-authored-by: leaf-agent <[email protected]>
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.
Long page histories exceeded the parsed-document cache, so state reads and source checks repeatedly reparsed completed revisions. A timed-out request could leave the server doing that work while its retry queued the same scan again.
Keep one bounded compact inventory per revision for Question registration, data bindings, and element IDs. Historical dynamic registrations reuse the canonical fold's last answer, keyed by its relevant event contents and withdrawals. Source saves and new revisions retain completed historical work without retaining document parses or complete event logs.
On the same 219-revision, 271-event page snapshot, repeated Question reads fell from 177 parses and roughly 2.5 CPU seconds to one parse and 0.07–0.09 CPU seconds, with identical output. The compact inventory used 5.5 MB within its 8 MiB budget.
Validation covers forced parse eviction, retries and new revisions, changed event payloads, Undo, restatement and report settlement, captured data contracts, nested sample scopes, and frozen thread markup. A headless copy of the historical page also exercises an actual read timeout, automatic retry, subsequent edits, and a choice surviving reload.
The full-suite gate also exposed a collapsed diff finishing its lazy source render after rendering had already been declared complete. Registered finite widget preparation now holds the canonical rendering reading until every capable producer finishes, including failed siblings and superseded or reconnected work. A held grammar request reproduces the old gap; the stability watcher remains unchanged.