Skip to content

Rift workspaces: a copy-on-write environment provider - #3229

Draft
ymichael wants to merge 13 commits into
mainfrom
bb/env-providers-3-rift
Draft

Rift workspaces: a copy-on-write environment provider#3229
ymichael wants to merge 13 commits into
mainfrom
bb/env-providers-3-rift

Conversation

@ymichael

@ymichael ymichael commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

BB had no environment provider for copy-on-write workspace copies. A plugin could create a directory, but sidebar grouping was tied to Git worktree identity, so independent copies could not present threads sharing that environment consistently.

What changed

Reviewer report — overview, SDK contract, verification, review fixes, and screenshots

Adds the optional BB Official environment-rift plugin (rift, “Rift workspace”). It checks the selected host for the Rift CLI, validates and initializes a standalone Git checkout, creates an all-files or filtered copy in a BB-managed attempt directory, creates the requested branch from the copied HEAD, and runs BB setup after Rift's hooks. Completed copies replay idempotently; incomplete copies are recreated. Removal respects ownership and confines fallback deletion to the exact managed attempt. Initialization is serialized and cancellation terminates hook process groups. The default retirement remains five minutes.

Adds optional provider presentation: { groupsThreads, kindLabel? }, with grouping defaulting to actual isWorktree, and wires it through the catalog, thread list, sidebar and info tab. SDK is bumped to 0.4.50 with API audit, API-map and skill entries. Shared setup/teardown execution is extracted for the worktree and Rift providers. No database migration or daemon wire change.

Rift is not a Git worktree: refs are independent and linked-worktree sources are unsupported. Filtered mode omits --copy-all because the current CLI has no --filtered flag. On this Mac, npm Rift 0.0.10's filtered copy also fails directly outside BB with Permission denied (os error 13); BB reports the failure without substituting all-files mode. Hook support depends on Rift's version. rift remove trashes the copy; rift gc physically reclaims storage.

How you verified

Rebased onto PR 1 head 2e5a6c0ba5, preserving its structural provider filtering and durable checkout-claim changes.

  • Repo-wide pnpm exec turbo run typecheck lint: 96/96 tasks passed.
  • Plugin tests with fake host dispatch and a real temporary Git checkout plus locally installed Rift: availability, first-init concurrency, dirty/dependency state, hook ordering and copied HEAD, replay/repair, named branches, guarded removal and cancellation.
  • Package test run: 14/14 tasks passed (Rift 7, app 3966, server 2304, API-map 73 tests). Test tasks for @bb/app, @bb/server, @bb/plugin-api-map, @bb/client-core, @bb/core-ui, and @get-bb/plugin-sdk.
  • Built SDK runtime, then cd tests/integration && pnpm exec vitest run --config vitest.config.ts --project @bb/integration-tests --maxWorkers=3, with the temporary Rift bin directory on PATH: 27 files, 55 tests passed (50.03s).
  • This worktree's isolated dev instance: catalog installation, setup-required/available states, real Codex replies and follow-up, two copies, shared-copy sidebar grouping, branch chip/info tab, five-minute retirement, and server-only SIGKILL during creation followed by replay of the same path key.
  • Five same-repository CLI samples: median Rift 30.64 ms, git worktree 15.79 ms on a small fixture; no speed advantage claimed from that workload.
  • Fresh implementation and rebase reviews: no remaining actionable findings. Screenshot/live evidence: /Users/michael/.bb/thread-storage/thr_w4cp8wrwjm/surface-report.md.

AGENT GENERATED

@ymichael
ymichael force-pushed the bb/env-providers-3-rift branch from c09d5ac to 696db2b Compare September 8, 2026 02:30
@ymichael
ymichael changed the base branch from bb/env-providers-1-environments to bb/env-providers-2-machines September 8, 2026 02:36
@ymichael
ymichael force-pushed the bb/env-providers-3-rift branch 3 times, most recently from 05707f6 to 9059e9b Compare September 8, 2026 11:49
@ymichael
ymichael force-pushed the bb/env-providers-3-rift branch from 9059e9b to d89789c Compare September 9, 2026 03:46
@ymichael
ymichael removed this pull request from stack #3232 September 9, 2026 03:49
@ymichael
ymichael changed the base branch from bb/env-providers-2-machines to main September 9, 2026 03:49
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.

1 participant