Skip to content

Prepare locked uv Python workspaces automatically - #2669

Merged
jonathanKingston merged 3 commits into
mainfrom
codex/prepare-python-uv
Sep 14, 2026
Merged

jonathanKingston merged 3 commits into
mainfrom
codex/prepare-python-uv

Conversation

@jonathanKingston

@jonathanKingston jonathanKingston commented Sep 13, 2026 •

Copy link
Copy Markdown
Collaborator

Locked uv projects currently need a manual Copse preparation declaration. Detect pyproject.toml plus uv.lock and synchronize the Python workspace with uv sync --locked --all-packages --no-python-downloads, using the project's .venv and a managed uv cache. Missing or conflicting inputs receive configuration guidance, and explicit declarations retain control of non-JavaScript setup.

This is the uv portion of #2654, stacked on #2388. Hash-locked pip, Cargo and Go remain open; this PR does not claim those adapters are implemented.

Readiness checks uv and Python identity and the locked installed environment on every inspection, invalidates on workspace manifests/configuration/version files, and preserves useful failed-check diagnostics. uv can execute build-backend/repository code, which the exact-command approval states. Neither uv nor Python is installed globally.

uv's check requires temporary bookkeeping, so preflight subprocesses receive private disposable scratch. The project and shared caches remain read-only, scratch is removed after execution, and offline network isolation has no shared proxy or unsandboxed fallback.

Validation:

  • Real installed uv 0.12.2/Python fixture: create a reviewed local-wheel lock, prepare and import the package, reuse offline, repair removed distribution metadata, reject changed plans and stale locks, and report missing offline inputs without rewriting the lock.
  • Unit coverage for detection, conflicts, explicit overrides, workspace/configuration fingerprints, runtime invalidation and readiness checks; real sandbox coverage for scratch cleanup and host containment.
  • Build and focused Electron approval eval passed; tests/e2e/screenshots/worktree-preparation-python.png was visually inspected.
  • Current pnpm run check: all static gates and 9,244 tests passed, with no failures or skips.

The real uv fixture explicitly skips when uv or Python is not installed; no test installs tools globally. Other unit and sandbox-boundary tests do not require uv. The design and remaining sequence are documented in docs/plans/project-worktree-preparation.md.

Rebased onto the CI fixes in #2388 at 31e5f3872. The inherited backup fix covers ordinary and linked worktrees without writable checkout mounts. Full CI is explicitly enabled for this draft via ci-full, including build and all e2e shards.

Full CI verification passed on b43e003bb: precheck, unit tests, build, benchmarks, all eight e2e shards, screenshot artifacts, and the aggregate CI gate. The repaired plan-value spec passed in a single 31-spec Linux shard run.

Includes the corrected proposed-image e2e fixture from #2388; approval-preview coverage uses a real non-Git workspace rather than depending on a failed recovery backup.

Two e2e harness races are fixed: the test launcher consumes a pending seed after the outgoing Electron process has saved its old config, and screenshot framing resolves its target by selector inside the page so transcript updates cannot invalidate a WebDriver argument. Regression tests cover node replacement and the seed handoff, including preserving subsequent product writes. All four affected Electron specs passed locally, and focused skill-error/roadmap screenshots were inspected.

The plan-value fixture now seeds its usage history and project together through that handoff. Its unchanged worth-it assertions pass, and refreshed worth-it/inference screenshots were visually reviewed. The full local gate remains green: 9,244 tests, no failures or skips.

@jonathanKingston jonathanKingston added the ci-full Force the full e2e suite (bypass the test-oracle thinning) on this PR label Sep 13, 2026
github-actions Bot added a commit that referenced this pull request Sep 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🖥️ PR preview

@copse-release-bot

Copy link
Copy Markdown
Contributor

Reference screenshots ready for review

Review GitHub’s image diffs in screenshot PR #2672.
Merge it (or enable auto-merge) to apply the accepted PNGs to codex/prepare-python-uv.

Rendered for b43e003bbfee by CI run 34766447517; the immutable artifact is reference-screenshot-candidates-34766447517.

If this source branch moves, a later successful render closes the stale review PR and replaces this link.

Base automatically changed from copse/build-2376-29fb13 to main September 14, 2026 12:14
@jonathanKingston
jonathanKingston marked this pull request as ready for review September 14, 2026 12:15
@jonathanKingston
jonathanKingston merged commit a1cdd57 into main Sep 14, 2026
22 checks passed
@jonathanKingston
jonathanKingston deleted the codex/prepare-python-uv branch September 14, 2026 12:15
github-actions Bot added a commit that referenced this pull request Sep 14, 2026
jonathanKingston added a commit that referenced this pull request Sep 25, 2026
## Outcome

The feature copy in `site/index.html` was last updated in early August.
Every `site/` change since then has only touched badges, links or the
architecture page. This PR updates the landing page to cover features
that have shipped since, limited to those that are **on by default**:

- **Tour:** a new fifth item, "Ship the pull request". It covers opening
a PR from the message box (#2324, #2047) and the PRs panel following
comments, reviews and individual CI checks (#2597). Its image,
`site/screenshots/create-pr-dialog.png`, is a 1200×800 downscale of the
existing e2e screenshot `tests/e2e/screenshots/create-pr-dialog.png`.
- **"Set the boundary" card:** adds allow, ask or block for each Copse
and MCP tool separately (#2688).
- **Other features:** the grid goes from 6 to 9 items.
- "Worktrees ready to work": dependencies are installed automatically
for Node, Python (uv), Go and Rust projects, and old worktrees can be
cleaned up in bulk (#2388, #2669, #2780, #2607).
- "Shells and a real browser": draw on a page to show the agent what to
change (#2934), and tabs come back after a relaunch.
- New: the agent can propose a new thread (#2334), image diffs in review
plus Copy image (#2637, #2760, #3038), and an unread marker plus a
one-click continue-plan suggestion (#1765, #1890).
- **Meta description and JSON-LD** now mention pull requests.

These features are deliberately **not** on the page because they're
experimental or not finished yet: SSH workspaces (marked
"(experimental)" in Settings), inline canvas, Apple Simulator and
Android, the VNC desktop viewer, container runs, Copse Reviewer,
automations, and multiple windows. For windows, `create-main-window.ts`
still throws "Agent actions are not available in secondary windows yet".
A separate investigation into which of these could be turned on by
default has been queued.

## Risk and review

Low. The site is static: this changes copy and adds one PNG. There's no
change to the app, and `site.js` and `styles.css` are untouched. The
site only deploys when `release` is pushed, not when this merges into
`main`. No independent review has happened yet.

## Validation

- `pnpm test -- sync-site-markdown`: 32 passed, 0 failed.
- `pnpm run site:md`: the generated Markdown copy includes the new
headings. The output is gitignored and not committed.
- `pnpm run check:local`: passed. Run on Node 22 in the cloud container,
where pnpm printed an engine warning.
- `pnpm run oracle -- --explain`: HIGH confidence, 0 mapped specs. The
full unit suite was deferred under the low-risk fast path; required PR
CI (`ci.yml`) will run it.
- Visual check: the page was rendered in headless Chromium at 1440×1000
and 390×844. After clicking "Ship the pull request", the tour image
switches to `create-pr-dialog.png` with naturalWidth 1200. The "Other
features" grid renders as 3×3 on desktop and a single column on mobile.
There's no horizontal scroll at 390px (`scrollWidth` is 390). This is a
static marketing page, not the Electron app, so there's no WebdriverIO
spec.

## Remaining work

- The new screenshot uses the app's current pink accent. The existing
site screenshots were captured when the app used a green accent, so
they're out of date too. Refreshing all of them from
`tests/e2e/screenshots/` would be a sensible follow-up.
- Browser tab restore is still listed under "Unreleased" in
`CHANGELOG.md`. Before the site is next deployed from `release`, check
that the published build includes it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01GkUNKJuLswZxUawPMmtRzi

---
_Generated by [Claude
Code](https://claude.ai/code/session_01GkUNKJuLswZxUawPMmtRzi)_

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Force the full e2e suite (bypass the test-oracle thinning) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant