Skip to content

Give developer tooling's Claude Code session, live page copy, move posting and suite checkout one home each - #5328

Merged
max-sixty merged 7 commits into
mainfrom
agent-af51b4772af940cea
Nov 4, 2026
Merged

max-sixty merged 7 commits into
mainfrom
agent-af51b4772af940cea

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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.

  • An interactive Claude Code session. leaf-dev claude-code-session repeated the claude-code journey's setup: the throwaway home whose .claude.json says onboarding is done and trusts the cwd, the environment over it, the claude command line and the isolation's layout. journey_claude_code.claude_code_environment writes the home and returns the environment, ClaudeCode builds the command line from the isolation, a model and optional settings, and Isolation.under lays out the state home, cwd and page. Neither command behaves differently.
  • A live copy of a saved page. The arrangement eval's judge and captures and the authoring eval's interaction probe each copied a saved page into a temporary directory and served it plain or through the arm's Leaf, deciding which in their own words. arms.live_copies does it once and yields a ServedPage carrying its arm and state home, so restored_page reads state through arms.read_page_state; arrangement_eval.is_leaf is the one test for whether a page is Leaf or plain HTML.
  • Posting a user move. Every caller of arms.PageClient.post read the served state for the active revision, posted, then searched the answer for its event by retry key, and post read the state again for the layer. post now 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 own error. The usability eval makes each round on one reading, withdraws a previous move by the event post returned, and loses arms.inputs_received and its retry-key bookkeeping.
  • A checkout the suite can run in. flake took a snapshot of the working tree inline, and bugback ran a detached git worktree at HEAD instead. suite.snapshot and suite.checkout (a clone with each node_modules linked in) are now shared by both. bugback still builds its reverted tree itself rather than taking arms.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 bugback runs 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 read node_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.
  • Snapshot clones are made with maintenance.auto=false and core.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.
  • Each posted move makes one state read rather than two. Every move of a usability round, an error's text included, describes and names one reading's revision. undoes: previous works when the previous move has its own retry key or is an error, where the log search raised StopIteration. Posting an undeclared kind gets the server's unknown-kind refusal.
  • The authoring eval's interaction probe serves its plain-HTML conditions plain, where only adaptive was; no case probes an html page today. A served copy keeps its saved directory's name rather than always page.

Tests: dev/tests/process/test_flake.py; the Codex App Server test test_app_server_delivery_id_reads_only_canonical_delivery_inputs inside a bugback checkout; bugback end to end, catching an uncommitted src/leaf edit with an untracked test; post against a served page for every kind, retries and an undeclared kind; and the journey and website post tests. The claude-code journey wasn't run, since it spends a login.

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

… 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.
@max-sixty
max-sixty merged commit 1391e3d into main Nov 4, 2026
4 checks passed
@max-sixty
max-sixty deleted the agent-af51b4772af940cea branch November 4, 2026 09:35
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