Files
orca/src
Brennan Benson d82bd80c56 feat(worktrees): make the removal target host-qualified by type (STA-4343)
removeWorktree now takes a required WorktreeRemovalTarget { id,
executionHostId } instead of a bare id plus an optional
options.requiredExecutionHostId. Optional was the hole: any caller that
omitted it was silently unguarded, which is how the sidebar stayed broken.
Required-but-nullable makes "this row declares no host" a deliberate claim
and makes a new unguarded delete entry point a type error.

Migrates all 8 destructive callers — #14606 previously touched only the
cleanup slice. The force paths matter most (DeleteWorktreeDialog,
worktree-delete-execution, WorkspaceSpaceManagerPanel): most destructive,
least re-checked.

resolveWorktreeBatchDeleteTargets now also rejects a host mismatch:
instanceId alone misses it whenever either row predates instance ids.

orca-runtime: the metadata purge falls back to the resolved repo's host
when the caller named none, so an unqualified purge cannot evict a same-id
row owned by another host.

Extracts removed-worktree-snapshot-prune.ts to keep remove-worktree.ts
under the 300-line cap (no max-lines disable).
2026-08-16 21:59:42 -07:00
..