Skip to content

Decide each coordinate's winner in one place, and file memberships by winner changes - #2603

Merged
max-sixty merged 2 commits into
mainfrom
server-owned-readings
Oct 12, 2026
Merged

max-sixty merged 2 commits into
mainfrom
server-owned-readings

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Four readers worked out which action wins a widget coordinate: the projection fold, build_threads, thread_memberships, and sample selection through memberships. This gives that rule one home, events.Standing, and makes the step-by-step reader linear.

The reading. An action stands from admission until an undo withdraws it or a version note retracts what it rests on, and the latest standing action wins, including one answering nothing. build_threads and the projection fold admit the log's actions with its whole floors and withdrawals. thread_memberships walks the log instead, handing undos and notes to withdraw and restate where they fall; each step reports a Change only where the winner moved.

Memberships are now exact. An event files under the threads it names, the membership of the gesture an undo takes back, and the answers of the winner before and after each change it causes. Before, a later action joined every earlier answer still standing at its coordinate, so it could release held news for an answer it did not unseat; a note now files only under threads whose closure it changes. Sample selection loses nothing, since #2515 copies whole coordinates.

Cost. A note reaches the actions resting on what it restates through an index, and each coordinate keeps its actions in an OrderedDict, whose tail stays constant to reach after removals. 64k actions at one coordinate, each undone newest- or oldest-first, take about 0.4 s.

Tests. test_every_change_to_a_threads_resolution_reaches_its_membership checks, over every three-step history of answers, non-answers, undos and notes at one coordinate, that each thread whose resolution build_threads changes is in the event's membership; the code before #2515 fails it. A case pins that undoing an answer another has superseded files only under its own thread. Across 28,561 four-step histories, build_threads matches the previous code and no note over-includes a thread.

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

max-sixty and others added 2 commits October 12, 2026 00:58
… winner changes

Four readers worked out which action wins a widget coordinate: the
projection fold, `build_threads`, `thread_memberships`, and (through
memberships) sample selection. `events.Standing` is now the one reading:
an action stands from admission until an undo withdraws it or a version
note retracts what it rests on, and the latest standing action wins.
Readers of the final state admit the log's actions with its whole floors
and withdrawals; `thread_memberships` walks the log, handing undos and
notes to `withdraw` and `restate` where they fall, and each step reports
the winner change it caused, if any.

Memberships are now exact: an event files under the threads it names, the
membership of the gesture an undo takes back, and the answers of the
winner before and after each change it causes. A later action no longer
joins every earlier answer still standing at its coordinate, only the
winner it displaced, so it releases no held news for an answer it did not
unseat, and a note files only under threads whose closure it changes.
Sample selection lost nothing: since #2515 it copies whole coordinates.

Every step costs what it touches: a note reaches the actions resting on
what it restates through an index, and each coordinate keeps its actions
in a linked order, so its winner stays constant to reach after removals.
64k actions at one coordinate, each undone newest- or oldest-first, take
about 0.4 s. A new test checks, over every three-step history of answers,
non-answers, undos and notes, that each thread whose resolution
`build_threads` changes is in the event's membership; main's code fails
it on the case #2515 fixed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 0162c92 into main Oct 12, 2026
3 checks passed
@max-sixty
max-sixty deleted the server-owned-readings branch October 12, 2026 15:57
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