Verify plugin workspaces on run leases and release settled tasks

Acquire the logical placement before verifying a retained checkout and reuse it through preparation. Persist definite refusal before release and preserve the existing workspace and session choices on fresh fallback and restart.

Always invoke provider release after task settlement. Reuse saved stop proof during cleanup retries and preserve completed run outcomes. Add database regressions for verification placement, restart, refusal, transport failure, and release replay.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Nicky LeachandPaperclip committed 2026-11-12 20:06:46 -08:00
1 parent 9b613562b7
commit 54ac0032dc
14 files changed
+539 -262

No files matched your search

@@ -416,7 +416,7 @@ databaseSuite("Core plugin Runner task lifecycle", () => {
return;
}
const next = await acquire;
expect(operations).toEqual(["stop", "status", "complete", "environmentAcquireLease"]);
expect(operations).toEqual(["stop", "status", "complete", "environmentReleaseLease", "environmentAcquireLease"]);
expect(next.lease.id).not.toBe(oldLeaseId);
await expect(resolvePluginTaskResume(db, { companyId, leaseId: next.lease.id, priorIdentity })).resolves.toBe("old-task");
await expect(runtime.task({ companyId, leaseId: next.lease.id, operation: { kind: "submit", projectIds: [], bootstrapTicket: "fixture", runner } })).rejects.toThrow("identity mismatch");