Repository navigation
Let an open tab follow a runtime edit and a detached host stage again, after #2336 - #2725
Merged
Merged
Conversation
#2336 made a shadow stage read its rules from the publication its host belongs to (`shadowRulesFor`), but a host that stands nowhere yet has no publication, so `vocabularyFor` returned null and `shadowStage` threw "Cannot read properties of null (reading 'shadowRules')". That broke the stated contract that a widget may fill its shadow stage while its host is still detached (test_a_stage_built_before_its_host_arrives_holds_its_links_and_bounds), and test_native_top_layers_bound_the_keyboard_stack, which builds its stage that way. A detached host now takes the document's own publication, which is where a host made by `document.createElement` arrives; generated widget children are still bound to their publication at creation (`createWidgetElement`). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Since #2336, `/api/state` names the active revision's layer (the current kernel) rather than the viewed revision's. After a runtime edit re-vendors the page into a new revision, an open tab therefore refuses the state before `prepareActivation` can reload it into that revision, which is how it followed the edit before. The refusal asks the document source instead (`sourceMovedOn`), but the live server's probe was the kernel's revision-addressed registry, an immutable resource that goes on naming the layer it was captured under, so the tab waited for an update that had already happened and never took the new theme (test_every_tab_follows_a_runtime_edit). A server without a release now probes its page-root `/registry.json`, which answers for the active revision. Delivery with a release (leaf.page's container, a live shell) keeps the kernel probe: there a changed kernel is a changed release, which every answer names, and the Worker routes only `revisions/` to the container. The tab now follows by the layer client's reload, keeping its saved scroll place but not the revision handoff (`reloadInto`) the old path carried. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
#2336 builds the banner's blanket answers ("Accept all") from the ask inventory rather than from the page registry's tags, since a widget in a frozen message declares `x-awaits.all` under its own publication. Before the first state answer there are no asks, so the control is not built at all, where it used to stand built and unoffered. The user still sees no stale bulk action during that interval, which is what test_a_current_auxiliary_choice_replaces_a_persisted_drawer_during_replay protects, but its read of the hidden control found no element and waited out its timeout. The test now expects no blanket control while the first state is held; its checks after the state lands are unchanged. The view's comment on when the controls are built now says so. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
enabled auto-merge (squash)
October 13, 2026 03:47
leaf-agent
approved these changes
Oct 13, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 13, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 16, 2026
Since #2725 (2026-10-12), when an agent re-vendored a page, its open tab reloaded at once, even mid-keystroke, without the revision handoff that carries the reader's place and open editor across. The cause was the quarter-second freshness check: `/api/news` answered in the page's newer layer, which the stale tab refuses, and #2725 pointed the refusal's source probe at the page-root registry, which now says the source moved, so `layer-client.js` reloaded immediately. State, event and deferred answers already spoke the layer of the revision the tab names, so the version controller would otherwise have taken the newer layer as a revision with a changed executable: the fresh-document install that waits while the user composes and hands their place across. Every authorized answer now defaults its `Leaf-Layer` to the layer of the revision the tab names (`_named_layer` in `http.py`), and the news check sends the layer headers that name it. A tab on the page's own layer skips the lookup. A revision this Leaf can no longer admit input against (`incompatible_revision`, a protocol bump) still answers in the page's layer, so that tab reloads at once rather than holding the user's send against a final refusal. Behaviour change: a re-vendor now reloads an idle tab through the revision handoff, and a tab with an unsent comment or reply follows once it is sent or dropped; before, both reloaded on the next news answer. Revisions that change only prose, markup or styles were and remain applied in place. Tests: `test_a_tab_on_a_re_vendored_page_hears_news_in_its_own_layer` and `test_a_tab_on_a_revision_past_a_protocol_bump_hears_the_newer_layer` (process), and `test_a_re_vendor_waits_for_the_reply_being_written` (browser, which replaces the server as a real re-vendor does); each fails on its own without the change. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[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.
#2336 broke three browser tests on main (each passes on its parent 6b9352e); main's push CI had not reported it. Two were real regressions:
test_every_tab_follows_a_runtime_edit). Keep captured widget publications independent of page revisions #2336 made/api/statereport the active revision's layer, so after a runtime edit the open tab refuses that state and falls back to probing the server, but the probe read/revisions/r1-…/registry.json, which never changes, so the tab waited forever. A server without a release now probes the page-root/registry.json, which follows the active revision (http.py). Release-bearing delivery (leaf.page, live shells) keeps its probe: there a changed kernel is always a changed release, and the Worker serves no page-root registry.test_native_top_layers_bound_the_keyboard_stack, andtest_a_stage_built_before_its_host_arrives_holds_its_links_and_bounds, whose contract says a widget may fill its stage while detached). A detached host now stages under the document's publication, the fallbackregistryForalready uses (shadow.js).One was a stale expectation: since #2336 the "Accept all" buttons are built from the asks waiting, so before the first state answer none exists rather than a hidden one (
test_a_current_auxiliary_choice_replaces_a_persisted_drawer_during_replay); the checks after the state lands are unchanged.A tab following a runtime edit now reloads plainly, which keeps scroll but not the in-progress edit, passage landmark or comparison that a revision handoff carries.