Repository navigation
Give developer tooling's Claude Code session, live page copy, move posting and suite checkout one home each - #5328
Merged
Merged
Conversation
… claude-code-session `leaf-dev claude-code-session` built its session by repeating the `claude-code` journey's setup: the throwaway home whose `.claude.json` says onboarding is done and trusts the session's cwd, the environment over it, the `claude` command line, and the isolation's directory layout, written out by hand. Each now has one home that both use. `journey_claude_code.claude_code_environment` writes the home and returns the environment. `ClaudeCode` chooses the session id and builds the command line from the isolation, a model and optional settings, so a caller no longer passes an argv. `Isolation.under` lays out the state home, cwd and page under a root and makes the cwd, as `isolated` did inline. Neither command behaves differently: the session still runs its own model with the working tree as its plugin and no extra settings, and the journey keeps its settings and its fork switch.
…horing evals Three places served a disposable copy of a saved page: the arrangement eval's judge (`restored_page`) and its captures (`capture_phase`), and the authoring eval's interaction probe (`operated_interaction`). Each made a temporary directory, copied the page into it, and served the copy with the static server or through the arm's Leaf. Each decided which in its own words: `condition == "html"`, `run.condition == "html"` and `condition == "adaptive"`. `arms.live_copies` now does this once. It copies each saved page directory under its own name, serves the copies as plain HTML or through the arm's Leaf under one shared state home, as the judge's linked pages had shared one, and yields a `ServedPage` for each. Each caller says whether its pages are plain from its own condition. Behaviour changes: - The interaction probe serves the authoring eval's plain-HTML conditions plain, as its capture already did. Before, only `adaptive` was served plain, and an `html` page would have gone to a Leaf server. No case probes an `html` page today: the widget-formats cases run `leaf`, `json` and `adaptive`. - A capture's or probe's copy keeps the saved directory's name, such as `page-phase1`, where it was always `page`. Leaf shows that name only as the title of a page with no title of its own.
Every caller of `arms.PageClient.post` repeated the same steps around it: read the served state for the active revision, post, then search the answered state for its event by retry key. These were `review_scenario.post`, stills' `comment_on` and `held_news`, the delivery eval, the claude-code journey's resolve, the usability eval's `post_round`, and a developer test. `post` read the state again for the layer, so each move made two reads. `post` now does all of it from one read. It adds the active revision to a move whose kind's record has a `revision` in the kernel registry's `$events.kinds` (comment, reply, seen, action, error) and leaves it off the other kinds a tab posts (edit, read, todo_end, resolve, unresolve, undo), whose closed records refuse one. A move that names its own revision keeps it. `post` returns the event the server's answer names (since #5307), which is exact for every kind: a retried attempt's earlier event, and the page's own `error`, which has no retry key to search by. Behaviour changes: - Each move makes one state read rather than two. - The usability eval names a revision only on a move whose anchor it found in the active revision's file, so the two still agree. Its other moves take the revision of `post`'s own read. Before, it put the round's revision on every kind but `undo`, so a resolve or edit move would have been refused. - The usability eval takes its admitted events from the server's answer, where it read them from the page's log on disk.
`leaf-dev bugback` ran its control and reverted runs in a `git worktree` detached at HEAD, so it refused a dirty working tree and asked for a commit first. Every other command that runs two versions takes the working tree as head, uncommitted edits included (#5239). `leaf-dev flake` already ran from a snapshot of the working tree: a clone whose HEAD commits the working tree as it stands, written inline in flake. That snapshot is now `suite.snapshot`, and `flake` and `bugback` both take it. bugback runs both of its runs in one snapshot, and its `git worktree` path is gone. bugback still builds its reverted tree itself rather than taking a base from `arms.choose_arms`. That base is the whole tree at the merge base, tests included, while the reverted run needs the working tree's tests over the merge base's code. Its header now says so. Behaviour changes: - bugback runs the working tree as it stands, with uncommitted edits and untracked files, where it asked for a commit first. An edit made while it runs reaches neither run. It refuses only when nothing outside `KEPT` differs from the merge base. - The snapshot clone is made with `maintenance.auto=false` and `core.fsmonitor=false`. Under this machine's git 2.56, the snapshot's commit started background maintenance that wrote a commit graph into the clone while the command was removing it. Removing a snapshot straight after taking it failed with "Directory not empty" in four of four tries, which is what bugback's quick refusal does, and in none of four with these settings. flake's snapshot takes the same settings.
…ncluded bugback ran its tests in the snapshot itself, which holds only what git does, so a test that reads an installed Node dependency errored there: the codex app-server tests' autouse fixture runs `node_modules/.bin/codex`. flake linked each `node_modules` into its checkouts in a helper of its own. `suite.checkout` now clones a snapshot into a checkout the suite can run in, with each of the working tree's `node_modules` directories linked in, and both commands run in one. `suite.clone` holds the settings every clone a command removes takes. bugback now checks that the working tree changes something outside `KEPT` before it snapshots, with `git diff` and `git ls-files --others` against the merge base, and it prints its verdicts before it removes its checkout. Behaviour changes: - bugback runs tests that read `node_modules`. - bugback refuses an empty change in seconds, where it took a whole snapshot first. Its output directory is made only once that check passes. - A failure to remove bugback's checkout no longer hides its verdicts. - flake's per-copy clones also start no git maintenance or file-system monitor.
…st made redundant
A usability round found its anchors and an error's `{line}` in the file of one reading
of the page, `page_state`, but most of its moves took their revision from `post`'s own
later read. An error could describe one revision and name another, and the moves of
one round could go out against different revisions. It also searched the log by retry
key for the event an `undoes: previous` move withdraws, and kept every round's retry
keys to feed `arms.inputs_received`, whose admission half `post` now guarantees and
whose other half repeated the round's own receipt check.
`post` now takes the revision any move names, the revision it was made on, and sends
it only where the move's kind has one, so a round names its reading's revision on
every move. `post_round` withdraws the previous move by the event `post` returned for
it, and a round counts as received once an opened pickup names each input of it that
owes the agent attention. `arms.inputs_received` and the retry-key bookkeeping are
gone. A kind the kernel doesn't declare now goes to the server, whose refusal says so,
where `post` raised a `KeyError`.
Behaviour changes:
- Every move of a usability round, an error's text included, describes and names the
revision of one reading.
- `undoes: previous` withdraws the previous posted move even when that move has its
own retry key or is an error. Before, the log search raised `StopIteration` there.
- `post` on an undeclared kind raises the server's `unknown-kind` refusal.
…state through read_page_state The arrangement and authoring evals decided whether a page was plain HTML three ways: `saved["condition"] == "html"` in `restored_page`, `run.condition == "html"` in `capture_phase`, and `not leaf` in the authoring eval's probe, beside `Run.leaf_condition` and the judge's `page["condition"] == "leaf"`. `arrangement_eval.is_leaf` now states it once; `Run.leaf_condition` and each of those callers use it. `restored_page` read a copy's page state by running `leaf page state` itself, a second copy of `arms.read_page_state`, because `ServedPage` held only a launcher bound to its arm and state home. `ServedPage` now carries the arm and state home, with `leaf` as a method over them, and `restored_page` calls `read_page_state`. No behaviour changes.
leaf-agent
approved these changes
Nov 4, 2026
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.
The last four developer-tool rows from the 2026-11-03 sweep for duplicate implementations (#5291, #5297). Each capability below was written more than once in
dev/leaf_dev/; each now has one home that every caller uses.leaf-dev claude-code-sessionrepeated theclaude-codejourney's setup: the throwaway home whose.claude.jsonsays onboarding is done and trusts the cwd, the environment over it, theclaudecommand line and the isolation's layout.journey_claude_code.claude_code_environmentwrites the home and returns the environment,ClaudeCodebuilds the command line from the isolation, a model and optional settings, andIsolation.underlays out the state home, cwd and page. Neither command behaves differently.arms.live_copiesdoes it once and yields aServedPagecarrying its arm and state home, sorestored_pagereads state througharms.read_page_state;arrangement_eval.is_leafis the one test for whether a page is Leaf or plain HTML.arms.PageClient.postread the served state for the active revision, posted, then searched the answer for its event by retry key, andpostread the state again for the layer.postnow does it from one read: it sends a revision only on the kinds whose record has one in the kernel registry's$events.kinds(comment, reply, seen, action, error), takes the revision a move names or else the active one, and returns the event the server's answer names, which is exact for retries and for the page's ownerror. The usability eval makes each round on one reading, withdraws a previous move by the eventpostreturned, and losesarms.inputs_receivedand its retry-key bookkeeping.flaketook a snapshot of the working tree inline, andbugbackran a detachedgit worktreeat HEAD instead.suite.snapshotandsuite.checkout(a clone with eachnode_moduleslinked in) are now shared by both. bugback still builds its reverted tree itself rather than takingarms.choose_arms' base, since that base is the whole tree at the merge base, tests included, while the reverted run needs the working tree's tests over the merge base's code; its header says so.Behavior changes:
leaf-dev bugbackruns the working tree as it stands, uncommitted and untracked files included, where it asked for a commit first, and it can now run tests that readnode_modules, such as the Codex App Server tests. It refuses an empty change in seconds, before snapshotting, and prints its verdicts before removing its checkout.maintenance.auto=falseandcore.fsmonitor=false. Under git 2.56 the snapshot's commit started background maintenance that wrote a commit graph into the clone during its removal, which failed with "Directory not empty" in four of four tries, and in none of four with these settings.undoes: previousworks when the previous move has its own retry key or is an error, where the log search raisedStopIteration. Posting an undeclared kind gets the server'sunknown-kindrefusal.adaptivewas; no case probes anhtmlpage today. A served copy keeps its saved directory's name rather than alwayspage.Tests:
dev/tests/process/test_flake.py; the Codex App Server testtest_app_server_delivery_id_reads_only_canonical_delivery_inputsinside a bugback checkout; bugback end to end, catching an uncommittedsrc/leafedit with an untracked test;postagainst a served page for every kind, retries and an undeclared kind; and the journey and websiteposttests. Theclaude-codejourney wasn't run, since it spends a login.