mirror of
https://github.com/stablyai/orca.git
synced 2026-10-29 16:17:51 +00:00
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).