Skip to content

Move cloud setup from shell script to wt alias - #5

Closed
max-sixty wants to merge 7 commits into
mainfrom
claude/zen-bardeen-iocf0n
Closed

max-sixty wants to merge 7 commits into
mainfrom
claude/zen-bardeen-iocf0n

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Replace the Codex Cloud-specific environment.sh setup script with a configure-cloud alias in .config/wt.toml, making the setup portable across cloud platforms.

Summary

The cloud container setup previously lived in a Codex-specific shell script with pinned tool versions. This change moves that setup into a wt alias that can be called from any cloud platform's initialization hook, eliminating version pinning and the need for checksum validation.

Key changes

  • Removed .config/codex-cloud/environment.sh and its README with Codex-specific setup instructions
  • Added [aliases] section to .config/wt.toml with configure-cloud command that:
    • Syncs the locked Python environment (uv sync --frozen)
    • Installs Playwright browser dependencies and Chrome
    • Installs and hooks pre-commit
  • Updated .gitignore to exclude .claude/settings.local.json (Claude's local settings file)
  • Added extensive comments in .config/wt.toml explaining the cloud setup strategy and why it avoids version pinning and piped commands

Implementation details

The alias is designed to be called from cloud platform setup hooks (Codex's setup/maintenance scripts and Claude's SessionStart hook). It requires wt to already exist, which is installed separately in each platform's initialization before the alias runs. This avoids the need for a separate script and allows both clouds to use the same setup logic through their own native mechanisms.

The setup uses sh compatibility (no pipefail) and avoids piped commands to ensure robustness — downloads write to files before execution rather than piping directly into shells.

https://claude.ai/code/session_01T397h81BEeHk9B953upvhV

claude added 7 commits August 17, 2026 17:48
Claude Code on the web starts a container with uv, node and Go on it and none of
what the gates need: no system Chrome, so every browser test fails at launch and
the Chromium that is preinstalled is a different build than the locked Playwright
expects; no pre-commit, so the lint cannot run at all. A `SessionStart` hook
supplies them now.

What it runs is the script Codex Cloud was already running, moved out of
`.config/codex-cloud/` because it was never one host's — both containers arrive
missing the same things, and a second copy of that list is a copy to forget the
day one of them gains a tool. Each host reaches the one script its own way, and
that is the whole of what either entry point says.

The hook is a wrapper rather than a path straight to the script because that
script installs system packages and approves this repo's Worktrunk commands
without review, which is a discarded container's business and not that of the
machine a developer runs `claude` from; `CLAUDE_CODE_REMOTE` is what keeps it in
the one. It runs synchronously so that no session opens on a half-built
environment and reads a browser failure as the change under test, and its
timeout is generous for the same reason — a cold container spends around ten
minutes, and a cap expiring part-way through delivers exactly the half-built
environment the sync is written to rule out. It speaks on stderr because a
SessionStart hook's stdout becomes the session's context, where an install's
hundreds of lines would arrive as if the repo had said them.

Codex's saved setup and maintenance commands need editing to match: the path
moved, and the pinned checksum changed with the script's new header.

Two tests cannot pass in Claude's container and no setup reaches them — it has no
IPv6 stack at all, so the pair binding the stated-host wildcard `::` fails on
socket creation. They are left failing rather than skipped, landing being
`wt merge` from a workstation where that gate still means what it says, and the
README names them so a session that meets them knows it has found the container
rather than its own change.

Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01T397h81BEeHk9B953upvhV
The steps live in `.config/wt.toml` now, as `wt configure-cloud`, beside the
pre-merge gates they exist to make runnable — one subject, one file. It is
runnable by hand in any container that already has `wt`, and
`wt config alias show configure-cloud` prints it rather than the reader having to
open a script to find out what setup means.

`environment.sh` keeps only what cannot be an alias, `wt` having to exist before
one can be invoked: install it, approve this branch's declarations, call the
alias. That ordering is load-bearing rather than tidy — a project alias is
approval-gated exactly like the pre-merge commands, so an unapproved container
would stop the setup at a prompt with nobody there to answer it.

Where the line falls between the two is measured, not taste. An alias runs under
`sh`, which has no `pipefail`, and a pipe's failure there passes for success: the
downloader piped into a shell is the one step where that silence installs nothing
and reports a clean setup, so it stays in bash where `set -euo pipefail` covers
it. Everything after it pipes nothing and is safe under the alias's `set -eu`,
which does abort — both halves checked rather than assumed.

Neither tool version is written down any more. `uv.lock` pins what `uv sync`
installs, and `.pre-commit-config.yaml`'s hook revs are what decide the lint, so
pinning the runner that reads them was a second number to bump for no behaviour it
could change. Worktrunk is installed unpinned and only when absent, which drops
the version compare too; the cost is that a cached container keeps the `wt` it was
built with until the cache is reset, and the gain is that it can start with no
network at all.

Codex's saved setup and maintenance commands need the new checksum. It now covers
a bootstrap with little reason to change, so the hand-copied hash stops being a
recurring chore — and it no longer covers the steps, which `--yes` approves
unread, a container's business and not a guarantee to lean on elsewhere.

Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01T397h81BEeHk9B953upvhV
`wt configure-cloud` was already the setup. What the scripts held was the one step
that cannot be an alias — `wt` has to exist before one can be invoked — wrapped in
a second file to reach it from. Both hosts already have a field where a command
string goes, so that step goes there and the repo keeps neither.

What made the bootstrap look like it needed a bash file was the pipe. A downloader
piped into a shell reports success when the download failed, having installed
nothing and left the setup to run without its tools, and `sh` has no `pipefail` to
catch it. Writing the download to a file and running the file removes the pipe, so
one chain runs under either host's shell and nothing is left that a script would be
for. Both halves were checked: the chain bootstraps from an empty container, and a
dead URL aborts it instead of carrying on.

Claude's registration moves to `.claude/settings.local.json`, gitignored, so the
repo no longer carries a hook that fires in every session on every machine; the
`CLAUDE_CODE_REMOTE` test is what covers a copy pasted onto a workstation.

The checksum goes with nothing left to guard. It read a script out of the branch,
which a task branch could rewrite before Cloud ran it unattended — the chain now
lives in the environment's own settings, where a branch cannot reach it. The alias
body is what the branch still decides, approved unread by `--yes` exactly as it
always was, the checksum never having covered it.

`.config/cloud/` held one file once the script went, so the documentation is
`.config/cloud.md`.

Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01T397h81BEeHk9B953upvhV
`cloud.md` had become a description of other systems' configuration — Codex's
saved environment settings and a gitignored per-container file — which nothing
here reads and nothing here checks, so it was free to go stale unnoticed. The
reasoning in it was already beside the alias, said twice.

What it uniquely held is the chain that reaches the alias, `wt` having to exist
before one can be invoked. That is ten lines, and they now sit above the alias
they lead to, where the rest of the story already was. Checked rather than
transcribed: every step of the comment's chain appears in the deployed hook
command, and the chain as written runs verbatim under plain `sh` from a container
with no `wt` on it.

Gone with the file, and cheap to restore from history if wanted: the Codex
environment settings table and the Cloud validation prompt, both from
8bd2998, and the note that the Claude container has no IPv6 stack, so the two
tests binding `::` fail there whatever the setup does.

Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01T397h81BEeHk9B953upvhV
The comment claimed the Claude side reached the alias through a `SessionStart` hook
in a gitignored file, which is not a mechanism at all: gitignored means a fresh
container has no such file and nothing there writes one, so what it described was
setup that would never run. The file existed only in the container that had been
told to make it.

CLAUDE.md is the mechanism, being read at the start of every session anyway. Its
cloud bullet says what a container hasn't got — the machine's Chrome the browser
suite attaches to, `pre-commit` for the lint — and carries the chain that installs
Worktrunk, approves the branch and calls `wt configure-cloud`. The hook and its
registration are deleted; nothing in the repo pretends to run anything.

The chain is in that bullet and nowhere else, `wt.toml` pointing at it rather than
repeating it, and Codex's setup script holding the only copy outside the repo. Both
were checked by extracting the block from the file and running it on a container
with `wt` removed. The note about the container's missing IPv6 landed there too,
where the agent reading a red suite will meet it.

Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01T397h81BEeHk9B953upvhV
The Worktrunk bootstrap existed to serve the choice of runner and nothing else. What
a container is missing is a synced environment, a system Chrome and pre-commit; none
of that wants `wt`. Putting the setup in an alias meant the container then needed
`wt`, which needed a download, a PATH line and an approval — eight lines of ceremony
to avoid repeating four of commands, and the `sh`/`pipefail` care taken over the
download was a cost of the same choice rather than a fact about the setup.

So there is no alias, `.config/wt.toml` is untouched, and the commands are in the
cloud bullet where an agent reads them. Three of them: `playwright install chrome`
fetches the browser's apt dependencies itself, which makes the separate
`install-deps` call redundant — checked by removing Chrome and installing it again
with that line gone.

The gitignore rule goes too, having been scaffolding for a hook that no longer
exists. A local settings file appearing untracked is its own matter, not this one's.

Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01T397h81BEeHk9B953upvhV
pre-commit installs a hook environment on first use, so warming them was a
convenience the setup does not owe: two lines of setup for one slow first lint.

Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01T397h81BEeHk9B953upvhV
@max-sixty
max-sixty force-pushed the claude/zen-bardeen-iocf0n branch from 66e282a to 6bf7fed Compare August 17, 2026 18:00

Copy link
Copy Markdown
Owner Author

Landed on main as 94fb4f7, squash-merged locally per CLAUDE.md — so GitHub won't detect it and this closes by hand.

What shipped is not what this description says. The wt configure-cloud alias, the .config/wt.toml change and the .gitignore rule were all removed before landing: the alias needed wt present, which needed a download-and-PATH bootstrap, which was more ceremony than the commands it wrapped. The final change is 14 lines added to CLAUDE.md and the 82 of .config/codex-cloud/ deleted — three commands an agent reads at the start of a session, no script and no runner.

Gates were run on the rebased tree: pre-commit run -a clean, and pytest tests --run-nightly at 731 passed, 6 skipped, with one failure and one error. Those two are test_the_stated_host_wildcard_serves_both_families and test_others_ships_on_a_network_facing_bind_too, which fail identically on origin/main in this container — it has no IPv6 stack, so binding :: fails at socket creation. The new CLAUDE.md bullet names them for that reason.

One follow-up outside the repo: the saved Codex Cloud setup command still points at the now-deleted .config/codex-cloud/environment.sh with its checksum, so it needs replacing with the three commands from the bullet.


Generated by Claude Code

@max-sixty max-sixty closed this Aug 17, 2026
max-sixty added a commit that referenced this pull request Sep 9, 2026
A preserving widget with any action or report was skipped by the render
gate, so unrelated prose replacement passed. Removing that exemption
directly would also reject legitimate reader rewrites and retired
content.

This compares every preserving owner with the canonical projected
passage. Page owners use the rendered revision's page projection; frozen
message owners use the conversation projection. Standing reader body
edits, retirement and undo, and declared generated additions flow
through the existing projection helpers. Reports remain unable to
authorize body rewrites. The action and report count now serves only the
caught-up readiness wait.

Tests reproduce action and report corruption, protect legal rewrite,
retirement, and undo behavior, keep a parent wrapper checked when only
its child acts, and pin page-versus-frozen scope. Existing dark-mode and
anonymous-owner regressions remain green. Completed workspace items #1,
#3, and #5 are removed from `TODO.md`.

> _This was written by Codex on behalf of max-sixty_
max-sixty pushed a commit that referenced this pull request Sep 18, 2026
`notes/workspace-followups.md` has been presenting finished work as the
plan since 9 September. It opens with "Start #2, #3 and #4 as one
coordinated contract batch; run the review-queue simplification #8
alongside it" — all four of those shipped that week — and carries
thirteen briefs, each with a live "Next task" and "Done when", for work
`TODO.md` dropped as complete. This removes them and leaves the six
`TODO.md` still links: #11, #14, #19, #20, #22 and #23.

The trim follows the convention #666 set and the reason `CLAUDE.md`
gives for it: a note is never a second specification for shipped
behavior. #666 removed #6, #7, #16 and #17 the same way, rewriting the
two `Owner / dependencies` lines in surviving briefs that named them; it
simply did not reach the rest.

Each removal is evidenced by the commit that took the item out of
`TODO.md`, not by a reading of the current code:

| Brief | Removed from `TODO.md` by |
| --- | --- |
| #1, #3, #5 |
[`0f7f06a6`](0f7f06a)
— "Completed workspace items #1, #3, and #5 are removed from `TODO.md`"
|
| #2, #4, #8, #9 |
[`28b5da99`](28b5da9)
— "the completed #2, #4, #6, #8, #9, and #17 backlog entries are removed
while preserving the deferred evaluation work" |
| #13, #15 |
[`6df40353`](6df4035)
— "closes three bounded workspace follow-ups" |
| #10, #12 |
[`c9eaa2c6`](c9eaa2c)
— the continuation cue and the adaptive Threads placement |
| #18, #21 |
[`e46c8b93`](e46c8b9)
— the monitoring workspace and its package-owned root |

Alongside the briefs, three group headings are now empty and go; the
`Suggested work packages` table loses the rows whose whole scope landed;
and four cross-references that named a removed ID are rewritten — #14's
dependency on the Threads-placement experiment, #20's ordering behind
#8, and the two sentences in `Reproduction record` and `Browser
evidence` that pointed at briefs no longer here.

#14 needed more than a rewritten pointer. The experiment it waited on
was settled in two steps, and only the first removed an ID: [PR
#520](#520) kept the adaptive
placement and deferred the modal-focus work to #24, which landed in [PR
#536](#536) as inertness, dialog
semantics and focus containment for a covering workspace. That is the
surface #14 exists to verify, so its `Done when` — "Avoid imposing a
modal focus trap on a nonmodal panel" — described the containment #536
shipped as the defect to avoid. It now states the containment the
shipped modality requires, and the dependency line names both
settlements.

The dated evidence sections themselves stay. They are the record of what
was read in a browser on 8 September, not a plan, and the note's own
header scopes them to that date.

No test covers `notes/`, and this changes no behavior, so there is
nothing to regress. `pre-commit` passes on the file; the `TODO.md` →
note anchors all still resolve, and no surviving text references a
removed ID.

---------

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Oct 6, 2026
The Leaves drawer keyed each neighbour row, and the focus it keeps
across a repaint, by the neighbour's URL. A neighbour whose server came
back on another port therefore read as one page leaving and another
arriving. The focused link was removed, and focus fell back to the
drawer.

Each entry in `state.others` now carries `page_key` (`state.page_key`,
the identity that page's state-home records already use) beside `url`.
The drawer keys rows and focus by `page_key` and links by `url`. A
restarted neighbour keeps its node and its focus, and Enter opens the
new address. The fresh-server check is unchanged: a neighbour with no
running server still leaves the list.

`test_a_leaf_served_at_a_new_address_keeps_its_row_and_focus` restarts a
focused neighbour on a new port. It takes the route a taken port's
refusal names: the service record is deleted, and the old port stays
held. The test fails on main because the row lost its node and focus.
With this change it passes. This resolves comparisons proposal #5, which
is removed from `notes/comparisons.md`.

**Is there a more underlying fix? No.** I tried these candidates:
- Enter on the retained link opens the new address. Covered in the new
test.
- The retained node's `href` follows the new URL. Covered in the new
test.
- Other code that reads a neighbour's identity: a grep of the runtime
and the Python found none. `presence.js` reads only the neighbours'
activity.
- During a restart, the row is absent from the moment the old server
stops until the new server publishes. A measurement showed about 70 ms
of that gap falls after `start_server` returns and before the first row
publication. The drawer treats an absent row as removal, and the
proposal keeps that behaviour (it retains the fresh-server checks). So
the gap is outside this change.
- History: the keying lines have stayed as written since #666 and #1214,
with no earlier patch to this condition.

Tests run: the new test (it fails on main and passes here); the drawer's
browser tests in `test_render_controls.py` and
`test_render_navigation.py` (49 passed); the neighbour tests in
`test_interact_server.py` (21 passed); pre-commit.

> _This was written by Claude Code on behalf of max-sixty_

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Nov 6, 2026
…ge; travel goes to a passage's first drawn line

Placement re-placed a thread only where a change touched the text nodes its last
successful match stood in, so what a resolution depends on beyond those nodes went
unheard. In Chromium and Firefox, on 58753e4:
- words a script took out of a marked phrase and, in a later task, put back left it
  unmarked (#1);
- a second copy of a quote written in its section, with no context to tell the two
  apart, left the first marked (#1);
- a word prepended inside a declared shadow stage a passage runs into left both pieces
  marked, since the native walker never reached the page's piece before it (#2);
- an element inside a passage made contenteditable, which fences it, left it marked,
  since the watcher reported only text writes and child lists (#3).
Each was a mark a fresh resolution rejects, or one it finds that wasn't painted.

The page's index of quotes (passages.js, `trackQuotes`) now holds what a quote's
resolution depends on: every copy of each quote the threads name, placed or not, and the
words a resolution read beside a copy to tell copies apart (`near`). Copies are found by
hashing their letters, so one pass over the page finds every quote's copies, where a
pattern apiece searched the whole page, once per thread (#4). Between readings the index
is carried through the span the two readings differ in (`changedSpan`), which compares
the readings themselves, so text, edges, fences and the order the walk reads the page's
trees in all count, by the reading's own rules: copies outside the span stand, shifted
past it, and the span plus the widest quote's letters before it is searched again. The
words watcher no longer interprets which nodes a change touched; it says the reading
changed, and which text nodes a change wrote or took out, whose live ranges the DOM
moved even where the page then reads the same. Placement places again, after the
script, the threads whose quotes the index says changed (`quotesChanged`) and those
whose text nodes were rewritten, placed before or not. `runsOn`, the native walker and
the per-reading, per-section regex cache go.

A thread that comes to stand where the last paint marked nothing for it, and didn't
choose to (a resolved thread, a drawing), is painted by a presentation, since only a
paint of the page knows where it falls among the marks (anchor-paint.js, `replace`).

Overlapping copies still collapse into the first. What changes: the regex's lead
consumed its text whether or not the rest of the quote followed, so a lead that failed,
or crossed a fence, hid a real copy starting inside it; now only a copy does. This
reaches only quotes that overlap themselves.

Step 0, a paragraph holding N marked passages, toggling a leading space (Chromium):
- origin/main (6cc574a): the edit searches nothing and its next presentation searches
  each quote over the whole page: 32/512/1,600 searches, 24k/6M/59M characters,
  4.8/127/1,077 ms. The merge base (6b3159d) is the same.
- 58753e4: the edit runs those searches (reviewer's measure 0.5/7.5/42 ms).
- Now: 0 searches; the edit takes 0.75/2.5/6.4 ms, which at 1,600 is re-placing the 1,600
  threads whose node the edit rewrote. Pointer moves: 1.17 to 1.27 ms at 512, 3.29 to
  3.32 at 1,600; the scaling page's 1,600-section edit 9.0 to 7.1 ms, moves 1.58 to 1.44.
- Each script task that changes the page's words now builds the page reading once, for
  the index to compare: 0.3/2.2/6 ms at 32/512/1,600 sections. A counter redrawn every
  frame far from any mark costs 1.5 ms more a frame at 512 sections and 5 ms at 1,600.
- A presentation on the 1,600-mark paragraph still takes about 0.9 s, on main too: the
  inventory keys each passage's row by reading its whole block (`passageRow`).
- B, threads placed again over 80 moves beside a counter: 0 at 32 and 512 marks.

Where travel lands (#5, #6). `passageStart` read a passage's first line down the page,
so in vertical-rl it returned one character and `t` left the column at y 765-1165 in a
900 px window, and it took the first segment even where it draws no box, so `t` left a
passage whose first words are display:none at y 1,685. It now takes the first segment
the browser draws a box for and reads its line along the block axis of its writing mode.

Tests, each failing on 58753e4 in Chromium and Firefox:
- test_a_mark_whose_words_a_script_puts_back_is_marked_again (#1);
- test_a_marked_phrase_a_script_writes_again_is_marked_no_more (#1);
- test_words_a_script_puts_inside_a_passage_s_shadow_stage_unmark_it (#2);
- test_a_passage_a_script_makes_editable_inside_is_marked_no_more (#3);
- test_travel_to_a_thread_shows_the_first_line_its_passage_draws, vertical and hidden
  start (#5, #6).
Runtime: a kept quote answers each of nine changes as a fresh pass does, and the quotes
the index says changed are those whose answer did; a change beside a told-apart copy
changes its quote. Each fails with the window search, the fence or segment comparison,
or the `near` check taken out.
max-sixty added a commit that referenced this pull request Nov 6, 2026
…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
max-sixty added a commit that referenced this pull request Nov 6, 2026
…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
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