Repository navigation
Choose every A/B command's arms one way, with the working tree as head - #5239
Merged
Merged
Conversation
…fix the --base help
# Conflicts: # dev/leaf_dev/commands/stills.py # dev/tests/model/test_stills.py
leaf-agent
approved these changes
Nov 3, 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 seven
leaf-devcommands that run Leaf at two versions (stills,probe,compare,pins,profile,bench-check,bench-latency) now choose their arms through one function,arms.choose_arms, and one option,--base [REF](arms.base_option). Head is always this working tree in place, uncommitted edits included. The base is the merge base withmain, or the commit--base REFnames. The arms are calledbaseandheadin every command's output, files and slots.Before this, the seven had four spellings (a positional
BASE_REF,--base [REF],--base REF,--tree), two meanings of head (stills,bench-checkandbench-latencybuilt the committed HEAD and told you to commit first; the others ran the working tree), five label sets, two ways to build the base (extract_arm,build_arm) and two implementations of--authored.What changes for each command
stillsBASE_REF; head = committed HEAD--base REF; head = working treebench-checkBASE_REF; head = committed HEAD--base REF; head = working treebench-latencyBASE_REF, head = committed HEAD; or--treefor the working tree alone--treedid);--base [REF]adds the basecompare--base REF;baseline/candidateslots and output--base REF;base/headprobeworktree; JSON fieldran; recordings inDIR/worktreehead; fieldcommit;DIR/headprofileworktreeheadpinsstills,compareandbench-checkalways run a base, since their readings mean something only beside it (base_option(paired=True));probe,pins,profileandbench-latencyrun one only when given--base. A bare--basetakes the next word as its REF, so the help says to put it after any arguments, asprobe's andprofile's did.One way to build the base
choose_armsbuilds the base withbuild_armfrom the whole tree at its commit, whichcomparealready needed, since its preview runs the base's ownleaf_devworker. A whole checkout makes--authoredone path mapping into it (arms.own_source), shared bystillsandcompare, instead ofstills' list of authored directories to extract andcompare's corpus special case.extract_armandbuild_pairare gone.On a quiet disk, building the whole tree took 2.7 s against 2.2 s for the payload and 0.4 s for
extract_arm, whose unbuilt payload then built its environment on its firstuv run. The whole tree is about 1,900 tracked files against 750 for the payload, beside a few thousand in the base's.venv, so under heavy disk contention the base takes proportionally longer to write.Head runs in place, as
probe,pins,profile,compareandbench-latency --treealready did, so an edit made during a longstillsrun reaches the states captured after it.Evidence
With an uncommitted edit to the heading of
examples/review-a-plan.html, on the merge commit6141620f3against its merge base18479950c:stills --state review-a-planprintedbase 18479950c5 vs head 6141620f3eand found the state unchanged, since both arms build the page from this working tree's source. With--authoredit found 428,017 px changed: the base read its committed heading and the head the edited one, which wraps to two lines.probe review-a-plan --js "document.querySelector('h1').textContent" --baseprinted one line forbaseand one forhead, each with its commit, both showing the edited heading.On
38fd46e3a, before merging main:pins --basewrote a report of "26 cases on this working tree against the base, b76f665", with 52lf-shotpairs.bench-latency --base --page triage-board --transition comment --runs 1printed abaseand aheadrow.profile triage-board comment --baseprinted the per-run detail forbaseandheadand the side-by-side summary.bench-check, narrowed to one page and one check per arm in a scratch script since it has no option for that, printedbase b76f665a2f vs head 38fd46e3a2and its table with the change column.compare review-a-planprinted abase:and ahead:preview URL within 25 s, both serving the page, with the base built under.tmp/compare/run-…/arms/base; SIGTERM stopped both previews.dev/tests/model/test_stills.py,dev/tests/journeys/test_compare.pyand the probe recording test pass, and pre-commit is clean. Across the seven commands andarms.py, the change removes 27 lines of code net (docstrings not counted) and adds 19 lines of docstrings.Left as they are
leaf-dev evaldeclares the same--base [REF]by hand and labels its armsbase/candidate; its arms stay payload-only copies, since its child agents must not read another arm's files. It can takebase_option()once theeval --fromchange touching that command lands.leaf-dev bugbackstill says to commit first: it reverts the branch in agit worktreedetached at HEAD, a different mechanism from these arms.