Skip to content

Classify each view's threads under its own registry, and drop the browser's re-filter - #2623

Merged
max-sixty merged 3 commits into
mainfrom
per-view-thread-reading
Oct 12, 2026
Merged

max-sixty merged 3 commits into
mainfrom
per-view-thread-reading

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

The server read every view's frozen threads under the active revision's registry. A view pinned to an earlier revision therefore received thread decisions its own widgets could not draw, and the browser filtered them out again with a JavaScript copy of same_state_operation (kept for that reason in #2482). Each view now carries its own thread reading, and the filter and its copy are gone.

Server

WorkReading.viewing(page) reads the log beside another revision's document and registry, sharing the task log and the published page's containment, so the threads themselves fold as before. browser_state takes each view's reading from it: the thread projection, the asks, each thread's attention and after, the view's queues and approval_blocking, and its undo offers all derive from that one reading. The active view reads exactly what it read before.

Wire shape: browser.thread becomes browser.views[revision].thread (threads, projection, asks). approval_history moves to browser.approval_history, since it reads no registry. page state reads the active view's thread.

The page protocol moves to 3. A page vendored at protocol 2 runs a runtime that reads browser.thread, so the server now refuses that page and names leaf page init to re-vendor it (layer-registry.md, "Page protocol"). build/browser/protocol-contract.d.ts restarts at 3.

Browser

normalizedProjection, normalizedQuestions, foldThreads' input, projectView, semantic news and frozen-message preparation read the view's thread. sameStateOperation and its Node test are deleted. Python's same_state_operation keeps the earlier-Leaf case, which test_interact_document.py holds. The Node test of the left-out entry also goes, since no entry can arrive that the view's registry does not classify.

Behaviour

On a pinned earlier revision, a frozen ask whose answer that revision's registry defines differently now shows open, with its thread the user's turn. Before, it showed answered while the decision itself was silently missing. The active revision is unchanged.

Tests

  • test_questions.py::test_a_pinned_view_reads_its_frozen_threads_under_its_own_registry serves both views of a log whose frozen widget's verb changed operation between registries. It checks each view's thread projection, ask status, attention and queue. When viewing is made to return the active reading, the test fails.
  • pnpm run check passes, including test:runtime and the bundle comparison.
  • The touched model and process tests pass.
  • Python tests that read the old shape use interact_support.served_thread, which takes the only served view's thread.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits October 12, 2026 10:28
…wser's re-filter

The server read every view's frozen threads under the active revision's registry,
so a view pinned to an earlier revision got thread decisions its own widgets could
not draw, and the browser filtered them out again with a JavaScript copy of
`same_state_operation`. Each view now carries its own `thread` reading:
`WorkReading.viewing(page)` reads the log beside that revision's document and
registry, and the thread projection, its asks, each thread's attention and
`after`, the view's queues and its undo offers all derive from it. The threads
themselves still fold under the published page's containment.

The browser reads `views[revision].thread` and keeps no filter; `sameStateOperation`
and its Node test go (Python's `same_state_operation` keeps the earlier-Leaf case,
held by `test_interact_document.py`). `approval_history` moves to the top of the
browser state, since it reads no registry.

User-visible change: on a pinned earlier revision, a frozen ask whose answer that
revision's registry defines differently now shows open, with its thread the
user's turn, instead of answered with the decision silently missing. The active
revision's reading is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wire change needs a page-protocol bump. browser_state no longer serves browser.thread, but a page vendored by the current protocol-2 Leaf still runs its own state-application.js, whose receiveState reads state.browser.thread.threads; it will throw before presenting the page. layer.incompatible_layer accepts that page because $events.protocol remains 2. Raise the kernel protocol in skills/leaf/assets/registry.json so the server refuses those pages with the existing re-vendor instruction, and update the protocol-dependent checks.

A page vendored at protocol 2 runs a `state-application.js` that reads
`browser.thread`, which the server no longer serves, so the server now refuses
it and names `leaf page init`, as `layer-registry.md`, "Page protocol", asks of
a served-state change.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 85f8244 into main Oct 12, 2026
3 checks passed
@max-sixty
max-sixty deleted the per-view-thread-reading branch October 12, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants