feat: add first-class worktree support - #388
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Too many files changed for review (1017 files, 100 file limit). |
|
Important Review skippedToo many files! This PR contains 832 files, which is 532 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (185)
📒 Files selected for processing (832)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Checkpoint via cy-loop-tasks (iteration 2, phase B mode=tasks). Focused evidence: worktree race unit suite, real-Git lifecycle integration, migration integrity/equivalence, and 80.8% package coverage. Heavy gates remain deferred to the QA tail by workflow direction. Co-Authored-By: Codex <[email protected]>
Checkpoint via cy-loop-tasks (iteration 3, phase B mode=tasks). Co-Authored-By: Codex <[email protected]>
Checkpoint via cy-loop-tasks (iteration 4, phase B mode=tasks). Co-Authored-By: Codex <[email protected]>
Checkpoint via cy-loop-tasks (iteration 5, phase B mode=tasks). Validated task and Loop worktree placement across queue snapshots, lease-fenced session binding, public contracts, real Git journeys, and generated artifacts. Co-Authored-By: Codex <[email protected]>
Checkpoint via cy-loop-tasks (iteration 6, phase B mode=tasks). Co-Authored-By: Codex <[email protected]>
Checkpoint via cy-loop-tasks (iteration 10, phase B mode=tasks). Focused Go race suites, web tests, typecheck, and lint passed. Browser and visual evidence remain assigned to the QA tail. Co-Authored-By: Codex <[email protected]>
Checkpoint via cy-loop-tasks (iteration 14, phase B mode=tasks). Adds the durable Worktree QA plan and closes lint, optional-state, native-tool metadata, and bundled-skill inventory gaps exposed by the full gate. Co-Authored-By: Codex <[email protected]>
| return ( | ||
| <> | ||
| <div | ||
| ref={submenu.triggerRef} |
There was a problem hiding this comment.
React Doctor · react-hooks-js/refs (error)
This component misses React Compiler's automatic memoization & re-renders more than it should: Cannot access refs during render. Rewrite the flagged code so the compiler can optimize it.
Fix → React refs are values that are not needed for rendering. Refs should only be accessed outside of render, such as in event handlers or effects. Accessing a ref value (the current property) during render can cause your component not to update as expected (https://react.dev/reference/react/useRef).
| <> | ||
| <div | ||
| ref={submenu.triggerRef} | ||
| onMouseEnter={submenu.openNow} |
There was a problem hiding this comment.
React Doctor · react-hooks-js/refs (error)
This component misses React Compiler's automatic memoization & re-renders more than it should: Cannot access refs during render. Rewrite the flagged code so the compiler can optimize it.
Fix → React refs are values that are not needed for rendering. Refs should only be accessed outside of render, such as in event handlers or effects. Accessing a ref value (the current property) during render can cause your component not to update as expected (https://react.dev/reference/react/useRef).
| <div | ||
| ref={submenu.triggerRef} | ||
| onMouseEnter={submenu.openNow} | ||
| onMouseLeave={submenu.scheduleClose} |
There was a problem hiding this comment.
React Doctor · react-hooks-js/refs (error)
This component misses React Compiler's automatic memoization & re-renders more than it should: Cannot access refs during render. Rewrite the flagged code so the compiler can optimize it.
Fix → React refs are values that are not needed for rendering. Refs should only be accessed outside of render, such as in event handlers or effects. Accessing a ref value (the current property) during render can cause your component not to update as expected (https://react.dev/reference/react/useRef).
| ref={submenu.triggerRef} | ||
| onMouseEnter={submenu.openNow} | ||
| onMouseLeave={submenu.scheduleClose} | ||
| onFocusCapture={submenu.openNow} |
There was a problem hiding this comment.
React Doctor · react-hooks-js/refs (error)
This component misses React Compiler's automatic memoization & re-renders more than it should: Cannot access refs during render. Rewrite the flagged code so the compiler can optimize it.
Fix → React refs are values that are not needed for rendering. Refs should only be accessed outside of render, such as in event handlers or effects. Accessing a ref value (the current property) during render can cause your component not to update as expected (https://react.dev/reference/react/useRef).
| onMouseEnter={submenu.openNow} | ||
| onMouseLeave={submenu.scheduleClose} | ||
| onFocusCapture={submenu.openNow} | ||
| onBlurCapture={submenu.handleBlur} |
There was a problem hiding this comment.
React Doctor · react-hooks-js/refs (error)
This component misses React Compiler's automatic memoization & re-renders more than it should: Cannot access refs during render. Rewrite the flagged code so the compiler can optimize it.
Fix → React refs are values that are not needed for rendering. Refs should only be accessed outside of render, such as in event handlers or effects. Accessing a ref value (the current property) during render can cause your component not to update as expected (https://react.dev/reference/react/useRef).
| sideOffset={0} | ||
| className={cn(WORKTREE_SUBMENU_FRAME_CLASS, "p-1")} | ||
| anchor={submenu.anchor} | ||
| onMouseEnter={submenu.openNow} |
There was a problem hiding this comment.
React Doctor · react-hooks-js/refs (error)
This component misses React Compiler's automatic memoization & re-renders more than it should: Cannot access refs during render. Rewrite the flagged code so the compiler can optimize it.
Fix → React refs are values that are not needed for rendering. Refs should only be accessed outside of render, such as in event handlers or effects. Accessing a ref value (the current property) during render can cause your component not to update as expected (https://react.dev/reference/react/useRef).
| className={cn(WORKTREE_SUBMENU_FRAME_CLASS, "p-1")} | ||
| anchor={submenu.anchor} | ||
| onMouseEnter={submenu.openNow} | ||
| onMouseLeave={submenu.scheduleClose} |
There was a problem hiding this comment.
React Doctor · react-hooks-js/refs (error)
This component misses React Compiler's automatic memoization & re-renders more than it should: Cannot access refs during render. Rewrite the flagged code so the compiler can optimize it.
Fix → React refs are values that are not needed for rendering. Refs should only be accessed outside of render, such as in event handlers or effects. Accessing a ref value (the current property) during render can cause your component not to update as expected (https://react.dev/reference/react/useRef).
| anchor={submenu.anchor} | ||
| onMouseEnter={submenu.openNow} | ||
| onMouseLeave={submenu.scheduleClose} | ||
| onFocusCapture={submenu.openNow} |
There was a problem hiding this comment.
React Doctor · react-hooks-js/refs (error)
This component misses React Compiler's automatic memoization & re-renders more than it should: Cannot access refs during render. Rewrite the flagged code so the compiler can optimize it.
Fix → React refs are values that are not needed for rendering. Refs should only be accessed outside of render, such as in event handlers or effects. Accessing a ref value (the current property) during render can cause your component not to update as expected (https://react.dev/reference/react/useRef).
| onMouseEnter={submenu.openNow} | ||
| onMouseLeave={submenu.scheduleClose} | ||
| onFocusCapture={submenu.openNow} | ||
| onBlurCapture={submenu.handleBlur} |
There was a problem hiding this comment.
React Doctor · react-hooks-js/refs (error)
This component misses React Compiler's automatic memoization & re-renders more than it should: Cannot access refs during render. Rewrite the flagged code so the compiler can optimize it.
Fix → React refs are values that are not needed for rendering. Refs should only be accessed outside of render, such as in event handlers or effects. Accessing a ref value (the current property) during render can cause your component not to update as expected (https://react.dev/reference/react/useRef).
| onMouseLeave={submenu.scheduleClose} | ||
| onFocusCapture={submenu.openNow} | ||
| onBlurCapture={submenu.handleBlur} | ||
| onKeyDown={submenu.handleContentKeyDown} |
There was a problem hiding this comment.
React Doctor · react-hooks-js/refs (error)
This component misses React Compiler's automatic memoization & re-renders more than it should: Cannot access refs during render. Rewrite the flagged code so the compiler can optimize it.
Fix → React refs are values that are not needed for rendering. Refs should only be accessed outside of render, such as in event handlers or effects. Accessing a ref value (the current property) during render can cause your component not to update as expected (https://react.dev/reference/react/useRef).
Summary
Add first-class Git Worktree support across the CompozyOS runtime, Web desktop, CLI, HTTP/UDS, native tools, extensions, configuration, generated contracts, and documentation.
Core Worktree lifecycle
The new
internal/worktreedomain owns Git capability detection, canonical repository identity, naming and placement, per-repository mutation locking, and durable lifecycle state.pending → readyoperation with recorded ownership checkpoints, bootstrap copy/setup support, cancel-safe rollback, and boot recovery.removing, rechecks session activity and Git safety under the repository lock, preserves branches and history, and requires an explicit second step for dirty or unique-unpushed work.The append-only global schema adds migration
00062, declarative fragments, Atlas history, and sqlc output for Worktree records, status, forge state, exit operations, session/Task bindings, and snapshotted Task Worktree policies.Agent-manageable public surface
Agents can manage the lifecycle without the Web UI or direct storage access.
compozy worktreeverbs for list, create, cancel, adopt, inspect, status, exit, commit, push, PR, exit-cancel, remove, and dismiss.compozy__worktreetoolset addscompozy__worktree_list,compozy__worktree_inspect,compozy__worktree_create, andcompozy__worktree_remove, with explicit risk levels, capability diagnostics, permission gates, descriptors, and catalog digests.Session, Task, and Loop isolation
Sessions accept an existing
worktreereference or atomically create throughnew_worktree. A bound session runs from the exact checkout while its parent workspace continues to own config, agents, skills, memory, and coordination.none,ref, andper_runWorktree modes. Enqueue snapshots the resolved policy on each run; the claimed run never rereads a later profile edit.per_runmaterialization stays inside the active lease, never reuses a worker session, and rolls back the checkout if ownership is lost or bootstrap fails.environmentcontract; the retired rawcwdfield is a hard validation failure, and nested Loops inherit the resolved environment unless they override it.Web desktop
The desktop adds the complete Worktree lifecycle and execution context while preserving the Global/workspace scope model from #368.
Assisted exit and Forge extension
The daemon computes one authoritative action ladder: Commit → Commit & push → Push → Open PR → View PR, pausing on active sessions, unknown status, divergence, missing capabilities, or unsafe cleanup evidence.
op_id, stream redacted step/hook output, survive request disconnects, and support exact-operation cancellation.forge.providerextension protocol defines capabilities, status, and PR creation. The bundled GitHub provider follows the credential ladder without sending credentials through extension payloads.Configuration, hooks, and documentation
[worktrees]configures managed placement, per-run branch namespace, bootstrap copy/setup, setup timeout, and discovery TTL.task.orchestration.profile.default_worktree_modecontrols the default Task policy. These keys participate in defaults, validation, overlays, typed mutation, live reload, examples, and settings diagnostics.Lifecycle hooks and events cover pre-create/pre-remove gates, create/adopt/remove observation, setup failures, missing/restored state, status refresh, branch reclamation, and exit progress. Hook errors fail open where specified; explicit synchronous denials return a typed refusal.
The docs site adds Worktree concepts, creation/adoption, navigation, Task isolation, Loop environments, assisted exit, removal/recovery, configuration, agent surfaces, generated CLI/API reference, extension-authoring guidance, and sidebar wiring. The official
skills/compozy/references cover the same public behavior.Rebase integration
This branch was rebased onto current
mainafter reading the merged PR descriptions and inspecting their commits and affected contracts:00060;00061;00062, including migration/reopen coverage across all three states;The rebase-specific contract fixes are isolated in
f63b2de2and the final full gate passed after the integration.QA and review
Real-user QA exercised the feature through the daemon, browser, CLI, HTTP/UDS, native tools, real Git repositories, configuration, hooks, Task fan-out, Loop environments, assisted exit, Forge degradation, and an adjacent workspace-add canary.
clean: truewith zero surviving processes.Full report:
docs/qa/reports/2026-08-13-worktree-support.md.Verification
make gate-full— PASS, CURRENT for fingerprinte8c4f97aa043afb234c8bd8df0e278ca7c8e4982-race; 2 platform/helper skips0 issues), tests, build, code generation, installer, product-language, source-size, and package-boundary checks passedmake test-e2e-runtimeandmake test-e2e-webpassed in isolated QACompozy Impact Audit
compozy__worktreetoolset and four Worktree tools; extends session creation, Task Worktree-policy/fan-out, and Loop environment schemas; co-ships descriptors, risk flags, availability diagnostics, capability gates, generated digests, fixtures, and permission tests.forge.providerprotocol and bundled GitHub provider; Worktree lifecycle/exit hooks and events; HTTP/UDS/CLI fallbacks for lifecycle actions without direct native tools; and complete[worktrees]config lifecycle. Bridge SDK, MCP sidecars, and unrelated registries remain unchanged after checking their registration surfaces.workspace_id; Global sessions keep the hidden home binding from refactor: add global workspace toggle #368 and cannot select project Worktrees; cross-workspace transport/tool tests reject leakage.skills/compozy/Worktree, configuration, Task/orchestration, Loop, extension-authoring, desktop, and native-tool references for every new public command, route, tool ID, hook event, capability, error code, and config key.