Repository navigation
Conversation
…ost (stablyai#8886) Lineage was scoped to one repository, execution host, and project, so `orca worktree set --parent-worktree` rejected cross-repo parents and stored cross-repo edges were silently dropped on read. Only the host boundary has a reason to exist (bare `<repoId>::<path>` ids collide across hosts, STA-4343), so the shared rule now checks the execution host alone. - Project the fleet scan across all repos of one host instead of per repo, so `worktree ps/list/show` report cross-repo parents and children. - The one-repo scoped lookup defers to the fleet scan when stored lineage links the worktree to another repo. - Lineage writes notify the new and previous parent repos too. - Parent pickers (context menu, composer, drag-drop) offer same-host worktrees from other repos and label their repo; the composer's stale-pick check compares hosts instead of repos. - Delete-with-descendants names a descendant's repo and serializes deletes of checkouts nested inside another repo's target, so a failed child still protects its parent directory. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (14)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughWorktree lineage now supports parent and child worktrees in different repositories or projects when they share an execution host. Runtime projection, scan invalidation, and repository notifications account for cross-repository lineage. Parent selection uses host identity and labels candidates from other repositories. Lineage views include same-host descendants, while deletion keeps nested same-host worktrees in an ordered sequence. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No actionable issue remains from this review; the change is ready for normal merge checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: c09a47f8-016f-47fd-aa67-28289824b38d
📒 Files selected for processing (33)
src/main/ipc/worktree-create-lineage.test.tssrc/main/ipc/worktree-remote.tssrc/main/runtime/orca-runtime-list-known-resolved-worktrees-for-explicit-target.tssrc/main/runtime/orca-runtime-tests/lineage-and-scan-cache.spec.tssrc/main/runtime/repo-worktree-row-resolution.test.tssrc/main/runtime/repo-worktree-row-resolution.tssrc/main/runtime/runtime-managed-worktree-metadata.test.tssrc/main/runtime/runtime-managed-worktree-metadata.tssrc/main/runtime/runtime-worktree-lineage-controller.tssrc/renderer/src/components/NewWorkspaceComposerCard.tsxsrc/renderer/src/components/new-workspace/ComposerParentWorktreePicker.test.tsxsrc/renderer/src/components/new-workspace/ComposerParentWorktreePicker.tsxsrc/renderer/src/components/new-workspace/NewWorkspaceComposerAdvancedSection.tsxsrc/renderer/src/components/new-workspace/new-workspace-composer-card-props.tssrc/renderer/src/components/right-sidebar/folder-workspace-attached-worktrees.test.tssrc/renderer/src/components/sidebar/DeleteWorktreeDialog.tsxsrc/renderer/src/components/sidebar/DeleteWorktreeLineageNotice.test.tsxsrc/renderer/src/components/sidebar/DeleteWorktreeLineageNotice.tsxsrc/renderer/src/components/sidebar/WorktreeParentPickerRow.tsxsrc/renderer/src/components/sidebar/delete-worktree-parallel-flow.test.tssrc/renderer/src/components/sidebar/folder-workspace-card-pr-display.test.tssrc/renderer/src/components/sidebar/visible-worktrees.test.tssrc/renderer/src/components/sidebar/workspace-delete-lineage.test.tssrc/renderer/src/components/sidebar/worktree-delete-execution.tssrc/renderer/src/components/sidebar/worktree-list-groups-lineage-nesting.test.tssrc/renderer/src/components/sidebar/worktree-parent-candidates.tssrc/renderer/src/components/sidebar/worktree-parent-eligibility.test.tssrc/renderer/src/hooks/composer-state/composer-card-contract.tssrc/renderer/src/hooks/composer-state/composer-card-props.tssrc/renderer/src/store/slices/worktrees-create-parent-pick.test.tssrc/renderer/src/store/slices/worktrees/create/worktree-create-parent-pick.tssrc/shared/resolved-worktree-lineage.test.tssrc/shared/resolved-worktree-lineage.ts
💤 Files with no reviewable changes (5)
- src/renderer/src/components/NewWorkspaceComposerCard.tsx
- src/renderer/src/components/new-workspace/new-workspace-composer-card-props.ts
- src/renderer/src/hooks/composer-state/composer-card-props.ts
- src/renderer/src/components/new-workspace/NewWorkspaceComposerAdvancedSection.tsx
- src/renderer/src/hooks/composer-state/composer-card-contract.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
Important
One correctness gap in the new cross-repo delete ordering: mergeGroupsWithNestedPaths compares hosts strictly while the delete lineage that feeds it treats an unset hostId as a wildcard, so a nested cross-repo descendant without a hostId can still be deleted in parallel with its ancestor.
Reviewed changes
- Host-only boundary —
sharesWorktreeLineageBoundary/WorktreeLineageBoundarynow scope a lineage edge by execution host alone; repo and project no longer bound it. - Per-host fleet projection —
projectRepoWorktreeRowsLineageco-projects every repo on a host and re-slices per repo;resolveScopedWorktreeIdRowdefers to the fleet scan on a cross-repo edge. - Cross-repo invalidation — a lineage write notifies the child, new parent, and previous parent repos, and invalidates an
id:parent's scan cache. - Renderer scoping — picker, parent eligibility, composer create pick, and the delete dialog/badge all use host-only checks; cross-repo candidates show a repo badge.
- Delete sequencing — nested delete groups merge into one ordered, child-first queue.
ℹ️ Inferred and remote-created lineage are written without invalidating the resolved snapshot
RuntimeWorktreeLineageController.hydrate() writes setWorktreeLineage after listResolvedWorktrees() has already re-cached the snapshot, and the runtime remote-create branch records lineage after its only invalidation. A projection reader can therefore report a freshly written cross-repo edge as flat until the snapshot TTL or another mutation. This pre-existed for intra-repo inferred edges, but host-only scoping now lets those writers persist cross-repo edges too.
Technical details
# Cross-repo lineage writers without a resolved-cache invalidation
## Affected sites
- `src/main/runtime/runtime-worktree-lineage-controller.ts:145-182` — `hydrate()` writes `setWorktreeLineage` at line 171 after `listResolvedWorktrees()` re-caches the snapshot at line 150, with no invalidate.
- `src/main/runtime/orca-runtime-create-managed-worktree.ts:128-146` — the SSH/runtime branch invalidates inside `createRuntimeRemoteManagedWorktree` (before lineage) and records lineage at line 140 with no follow-up invalidate, unlike the local branch (`:208-209`).
## Required outcome
After either writer persists a (now possibly cross-repo) edge, the resolved snapshot and the affected repos' scan caches are invalidated so the next `listManagedWorktrees`/`showManagedWorktree` reflects it.
## Open questions for the human
- Is `hydrate()` always followed by a renderer-triggered catalog refresh, making the projection staleness moot in practice?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
An unknown host was treated as compatible with any host. That was safe only while lineage stayed inside one repo, because a repo lives on one host. With cross-repo parents it let an unhosted row nest under a row on another machine. The boundary now keeps that wildcard for same-repo edges only; across repos both hosts must be known and equal. The desktop create path resolves a parent's host from its owning repo when legacy metadata has none, so a recorded cross-repo edge can never name two hosts (which would make filterLineageForHost reject the host). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Nested delete groups were merged only when both targets named the same host, but lineage admits an unhosted same-repo child under a hosted parent. Such a child could be deleted in parallel with its ancestor, and its failure no longer protected the parent directory. Nesting now uses the shared lineage boundary for its host comparison. The child-first sort compared raw path lengths while nesting compares folded paths, so a child spelled through the shorter WSL UNC alias (`\\wsl$\`) sorted after a parent spelled `\\wsl.localhost\`. Sort on the folded spelling too. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Two writers record lineage after the fleet snapshot was cached: inferred-lineage hydration (it reads the snapshot to find candidates) and the SSH/runtime create path (a startup terminal resolves the new worktree after the create's only invalidation). Readers then reported the new edge as flat until the snapshot expired. Cross-repo parents make both writers produce edges the per-repo listings cannot show, so drop the snapshot once an edge is actually written. Hydration that writes nothing leaves the cache alone. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Re the pullfrog review note on late lineage writes: real finding, fixed in 9d2e583 — hydrate and the SSH/runtime create path now drop the resolved snapshot after actually writing an edge. It was reproducible, not just TTL: a startup terminal resolves the new worktree and caches the snapshot before lineage is recorded. The repo scan caches hold only |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Tightened
sharesWorktreeLineageBoundaryso a cross-repo edge requires both endpoints' execution hosts to be known and equal; an unknown host is only compatible within one repo. - Resolved a legacy host from the owning repo in the create-time boundary check, so a cross-repo parent whose metadata lacks a host is still accepted when its repo names the child's host.
- Switched
mergeGroupsWithNestedPathsto the shared lineage boundary and sorted child-first on folded paths, closing the unhosted cross-repo delete gap and the WSL UNC alias ordering. - Invalidated the resolved worktree snapshot after
hydrate()infers edges and after the remote-create path records lineage, so a freshly written edge is not hidden by an earlier cached fleet scan. - Added tests for the unhosted cross-repo rejection, same-repo unhosted delete sequencing, WSL alias ordering, and post-write invalidation.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…ee-lineage # Conflicts: # src/renderer/src/components/sidebar/worktree-delete-execution.ts
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Merged
origin/maininto the branch. Among the PR's own files, onlyworktree-delete-execution.tsand two delete tests changed: the merge pulled in upstream's#2259delete-concurrency refactor (started/settleddescendant awaits plusserializedfor non-local hosts) on top of the branch'smergeGroupsWithNestedPaths. - Confirmed the branch's cross-repo delete ordering survives the merge:
mergeGroupsWithNestedPathsstill merges same-host nested groups across repos into one ordered, child-first queue, so the new descendant-await loop sequences a cross-repo child before its parent and a failed child still stops it. - Upstream's new concurrency tests supersede the old single-repo nested test; the branch's cross-repo intent tests (child-first, failed-child-stops-parent, unhosted nested child, WSL UNC alias ordering) are intact.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
…ee-lineage Resolve DeleteWorktreeDialog/DeleteWorktreeLineageNotice against the delete dirty-change previews (f255574): keep both the previews and the cross-repo descendant repo badge. Upstream's additions left both files at their max-lines limit, so the badge inputs travel as one repoScope prop and the post-record snapshot invalidation moves into the shared recordCreatedWorktreeLineage wrapper instead of the remote create branch. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Merge of origin/main into the branch (head 232e7447). Among the PR's own surface only two files needed conflict resolution, and both preserve the branch intent:
- Relocated the post-record snapshot invalidation — moved out of the SSH create branch into the shared
recordCreatedWorktreeLineagewrapper onOrcaRuntimeWithActivateManagedWorktree, so both local and remote creates re-read the projection after an edge lands. Both create paths inherit the wrapper, so nothing is lost. - Rebased the delete lineage notice onto upstream's dirty-change previews (
f255574d26) —DeleteWorktreeLineageNotice/DeleteWorktreeDialogkeep upstream'sdirtyChangePreviewsByWorktreeIdrendering alongside the branch's cross-repo descendant repo badge, folded into one optionalrepoScopeprop to stay within max-lines.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

ELI5
When one piece of work spans two repositories (say a backend repo and a shared-library repo), you want the two worktrees to sit together in the sidebar, one nested under the other. Orca used to allow that and then stopped: the "Set Parent Worktree…" picker only offers worktrees from the same repository, and
orca worktree set --parent-worktreerefuses a parent from another repository. This change lets any worktree on the same machine be the parent. Picking a parent on a different machine is still blocked.What Changed
Before: a parent in another repo is rejected with
LINEAGE_PARENT_CONTEXT_CONFLICT: Parent worktree must belong to the same repository, execution host, and project.Cross-repo links that were already stored are hidden:worktree ps/listreportparentWorktreeId: nulland the sidebar shows the rows flat.After: both pickers (context menu and new-workspace composer), drag-and-drop reparenting, and the CLI accept a parent from any repo on the same execution host. The sidebar nests it and each candidate row shows its repo badge.
worktree ps/list/showreport the link.How it works:
sharesWorktreeLineageBoundary(src/shared/resolved-worktree-lineage.ts) now checks the execution host only. Write validation, read projection and the pickers all go through it. Before, the pickers each had their own copy of the repo check.<repoId>::<path>ids can collide across hosts.resolveScopedWorktreeIdRowassumed lineage never crossed repos ("intra-repo by construction"). It now defers to the fleet scan when stored lineage links the worktree to another repo, as parent or child. Same-repo lookups keep the fast path.id:parent. Otherwise the parent's children list goes stale.Why
The host part of the rule is the only part with a stated reason: worktree ids are bare
<repoId>::<path>(STA-4343), so a link between hosts could send an action like "delete all" to the wrong machine. That check is kept exactly as strict as before. The repo and project checks were added alongside it in #9913 with no rationale, and removing them costs nothing: no part of lineage reads the parent's branch, head, path or base ref.Alternatives considered:
Linked Issue
Fixes #8886. This implements the first proposal (cross-repo parent selection). Once nesting works across repos, a multi-repo feature can be grouped under one parent, which is what the "cross-repo workspace" alternative asked for. Happy to leave the issue open if you'd rather track the grouping proposals separately.
Visual Proof
Two throwaway repos: repo A (
orca-e2e-repo-…) and repo B (service-b). Repo B'sfeature-bis given repo A'se2e-secondaryas its parent. Captured from a hidden window through the e2e fixture, with isolated userData and HOME.main)Parent worktree must belong to the same repository, execution host, and project.feature-bis nested undere2e-secondary("1 child")mainmain, labeled with its repo badge.e2e-secondaryisn't listed because it's already the parent.Testing
Tests, all through
pnpm:tclintrun check:code-quality:changedtestover the 223 lineage / parent / delete test files plusorca-runtime.test.tsbuildelectron-vite build --mode e2epasses on both branchesWhat the tests cover:
AI Disclosure
Written with Claude Code (Claude Opus 5.5): investigation, implementation, tests and this description. I reviewed the diff and screenshots and re-ran the core lineage suites.
Review
worktree ps/list/showcan now contain cross-repoparentWorktreeId/childWorktreeIds(rule 3 ofremote-wire-compatibility.md).orca worktree createinferred from the calling terminal, which it stores without a boundary check (that path never had one).visible-worktrees.test.tswere updated to match.parentWorktreeId, so it won't show cross-repo links. With "group by repo", a cross-repo child stays flat in its own repo's section.Agent skill upstream boundary
Notes
Screenshots are hosted on a separate asset branch of my fork, not committed to this PR.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred).buildwas not run locally; CI will cover it.🤖 Generated with Claude Code