Repository navigation
Description
Chore Type
General task
Description
After #1687's WP3, the largest remaining cluster of redundant
init-workspace.sh renders in tests/bats/init-workspace.bats is the
_upgrade both "$ws" family: ~13 tests that run the script into an
empty directory via _upgrade (real just on PATH, uv stubbed)
purely as setup, then mutate or inspect the tree. WP3 did not convert them
because _upgrade differs from _scaffold in two ways — real just (the
base-recipe repair probes just --show) and a stubbed uv — and nobody
proved that on an empty directory the resulting tree equals the both
fixture.
Either it does, and those sites become _clone_shared both (≈13 renders
saved, ~4s under -j 8), or it does not, and they get their own
upgrade-both fixture in setup_file, which saves the same renders.
Acceptance Criteria
- The equivalence is settled by evidence: render
_upgrade bothand
_scaffold bothinto empty directories and compare withdiff -r+
find -printf '%m %y %p'(the WP2/WP3 proof method); paste the
verdict in the PR - If identical: pure-setup
_upgrade bothsites (empty target, no
assertion on the run's output/failure, no seeded files) are converted
to_clone_shared both, following WP3's conversion rule verbatim - If not identical: an
upgrade-bothfixture is added tosetup_file
(rendered the way_upgraderenders — realjust, stubbeduv) and
the same sites clone it - Sites whose subject is the upgrade run itself (repair messages,
assert_output --partialon the run,--separate-stderr) keep their
real invocation -
init-workspace.bats300/300; invocation count before/after recorded
(the [CHORE] BATS runtime: parallelize the suite, batch the init-workspace.sh fork loops, collapse redundant scaffolds #1687 counting-shim method: 250 after WP3)
Implementation Notes
- The interesting difference is the
just synctail step:_scaffold
stubsjust(so nothing runs) while_upgraderuns the realjustwith
uvstubbed — the recipe executes,uv syncis a no-op. Whether that
leaves any trace in the tree (a.venv, a lock, a log) is exactly the
question. - Do this after [CHORE] Render init-workspace.bats shared fixtures concurrently in setup_file #1695 if the outcome is a new
fixture, so the extra render is free.
Related Issues
- Follows [CHORE] BATS runtime: parallelize the suite, batch the init-workspace.sh fork loops, collapse redundant scaffolds #1687 (WP3 left this cluster alone deliberately), PR chore(ci): cut the BATS suite runtime #1690
- Sibling: [CHORE] Render init-workspace.bats shared fixtures concurrently in setup_file #1695 (concurrent
setup_filerenders)
Priority
Low
Changelog Category
No changelog needed
Activity
test(bats): clone the both fixture for pure-setup upgrade sites
c-vigo commentedon Sep 25, 2026
Settled (PR branch
bugfix/1694-worktree-bats-isolation): they are identical._upgrade bothand_scaffold bothrendered into empty directories, three rounds each:diff -rclean every time, andfind -printf '%m %y %p' | sortlistings identical everytime. The
just synctail step leaves no trace in the tree — no.venv, no lock, no log.The only difference is on stdout, the extra line the real
justprints:(plus the workspace-path echo and rsync's byte counters, both trivially path-dependent).
So the first branch applies: the sites become
_clone_shared both, noupgrade-bothfixtureis needed.
One correction to the estimate. "~13 tests" is too high. Applying WP3's conversion rule
verbatim — empty target, no assertion on the run's output or failure, no seeded files —
exactly 5 of the 35
_upgradesites qualify: the first run of the#878stock test(whose subject is the second run) and the four
#886--previewsetups. The other 30 seeda consumer file first (the whole point of an upgrade test) or assert on the run itself.
Invocation count 248 -> 243, not ~237. The saving is smaller than hoped, but the equivalence
verdict is the durable half: it is now recorded in
_clone_shared's CONTRACT comment so thenext reader does not re-litigate it.
test(bats): isolate worktree.bats and tighten the BATS suite (#1709)
c-vigo commentedon Sep 25, 2026
Shipped to
devin #1709. Verdict: identical (diff -r and modes clean, three independent rounds); 5 pure-setup sites converted, invocations 250 → 243; the CONTRACT comment records the proof.