Add worktree preparation for project dependencies - #2388
Conversation
Reference screenshots ready for reviewReview GitHub’s image diffs in screenshot PR #2671. Rendered for If this source branch moves, a later successful render closes the stale review PR and replaces this link. |
|
Validation found one blocking containment mismatch on current head. The approval copy says writes are limited to the active worktree and Copse-managed caches, but Please run both preparation subprocesses inside an enforcing sandbox whose only write grants are the execution root and the enumerated managed cache roots, and add an adversarial fixture proving a spoofed native-preparation script cannot write elsewhere. Until then, keep this draft. The focused screenshot itself looks clear, and the latest source CI is green, but those do not establish the bounded-write claim. |
3ef65db to
003495f
Compare
003495f to
8b66350
Compare
bcaf9d5 to
4ab1055
Compare
Introduce preflight and approved preparation tools backed by managed caches, explicit native artifact setup, cache-aware shell execution, and focused readiness and visual coverage. Co-Authored-By: Copse <noreply@copse.dev> Copse-Models: acp:codex-acp#gpt-5.6-sol, acp:claude-acp#opus[1m]
4ab1055 to
c68879d
Compare
## 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>
Closes #2376.
Fresh worktrees can now check and prepare the project's own dependencies through one bounded capability. Preflight detects npm, pnpm, Yarn Classic/modern, or Bun from the package-manager declaration and lockfile, reports runtime requirements and dependency state, and returns an exact preparation plan. Optional native setup and other ecosystems use
.copse/worktree-preparation.jsonto declare commands, inputs, and read-only checks. This repository's Electron/gortex setup uses that same declaration.Preparation approval displays the actual install and declared setup commands, network policy, and selected project. The preflight fingerprint is required and rechecked before each step. Installs use frozen lockfiles and manager-specific lifecycle disabling through Socket Firewall. All subprocesses remain inside the OS sandbox; preflight and offline preparation have no network access. Writes stay in the selected project and fixed managed caches, with no unsandboxed fallback.
Workspace detection follows declared patterns and exclusions, including
apps/layouts. Readiness invalidates on runtime/manager identity, manifests, lockfiles, package configuration, patches, declared inputs, and opted-in version-check output. Nested project selection is confined to the execution root. Unknown projects and conflicting inputs receive configuration guidance; readiness covers dependencies and declared checks, not build/test success.Compatibility includes npm, pnpm, Yarn 1/2/3/4, Bun text/binary locks, Yarn Plug'n'Play, and Python virtual-environment interpreter symlinks. Modern Yarn requires an exact version declaration so its build-disabling flags are unambiguous. Runtime installation/version switching and Windows sandbox support are separate capabilities.
Validation:
pnpm run check: all static gates and 9,235 tests passed, with no failures or skips.Visual evidence:
tests/e2e/screenshots/worktree-preparation-tools.pngandtests/e2e/screenshots/worktree-preparation-approval.png.The general contract and roadmap are in
docs/plans/project-worktree-preparation.md. #2654 tracks automatic Python/Rust/Go adapters; #2655 tracks JVM/.NET/Ruby/PHP adapters. Declarations support these ecosystems now; automatic detection is not claimed before its adapter and real tests ship. #2377 and #2378 remain independent Git and edit-ownership workstreams.Co-Authored-By: Copse noreply@copse.dev
Copse-Models: acp:codex-acp#gpt-5.6-sol, acp:claude-acp#opus[1m]
Current follow-up: #2669 adds automatic locked uv/Python preparation on top of this foundation. #2654 remains open for hash-locked pip, Cargo and Go.
CI repair: rebased onto main at
a184d2792, including the data-stable model-intellect assertion. Backups now keep the checkout read-only while writing Git objects/refs/logs and the scratch index, preventing Linux sandbox placeholders from enteringgit add -A. Regression tests cover ordinary home-contained repositories, nested linked worktrees, exact snapshot contents, unchanged index/status, and denied writes to working files, config and hooks. The focused model-picker Electron test passed and its screenshot was inspected.The read-only chat-store mount also excludes its scratch directory and active checkout, preserving their separate write grants on Linux. Current head:
31e5f3872. Full CI verification passed: precheck, Linux unit tests, build, benchmark, all eight e2e shards, and the aggregate CI gate.The proposed-image e2e fixture now uses a real non-Git project to require approval. It no longer relies on a Git backup failing. The focused image and Changes-refresh specs both passed; the proposed-image screenshot was inspected and matches the existing reference.