perf(server): reject shared Git cleanup paths before history scans (#16614)

Check the existing global execution/project shared-path veto before scanning retained run contexts. Preserve the full unshared-path query, lifecycle locks and all deletion-phase rechecks.

Verify with 35 focused real PostgreSQL/Git cases, full repository typecheck/build, exact-head full CI/E2E and Greptile Base 5/5. A read-only same-snapshot query pair retained the false verdict while reducing round trip from1089ms to9.4ms; this is not a full-agent latency result. The first security scan was inconclusive after an infrastructure checkout failure; one actual rescan passed.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip authored and GitHub committed 2026-10-16 18:17:15 -05:00
1 parent 564d4e1bce
commit dc499ae02b
3 files changed
+112 -11

No files matched your search

+5
View File
@@ -2596,6 +2596,11 @@ PR merge or delivery status. Enable it with
reclaimed bytes, base removal, and skip reasons. The existing bounded lifecycle
sweep supplies scheduling and shutdown cancellation.
The eligibility query first rejects paths shared with another execution or
project checkout. This prevents a known shared-path veto from scanning retained
run contexts. Unshared paths still require every existing task, run, recovery,
lease, service and filesystem check in the same lifecycle lock.
Before deletion the worker fetches the exact commit into a fresh object store
using the company's normal Git identity and commits a versioned restoration
recipe to workspace metadata. Current runs, previews, pending reopening,