fix(supabase): targeted review LOWs on retry and sandbox isolation

fail_sheet_verification refuses lease_expired (the claim's record, never a
worker report); the sandbox state dir guard resolves the repository path; the
avatar suite also refuses keys not issued by the sandbox. pgTAP 021: 90.
This commit is contained in:
bchanot committed 2026-11-01 23:13:42 +01:00
1 parent 2762ad2aba
commit 3c141c942b
4 files changed
+18 -4

No files matched your search

@@ -398,7 +398,9 @@ declare
v_definitive boolean;
begin
perform private.require_service_role();
if code is null or not (code = any (private.sheet_worker_codes())) then
-- `lease_expired` is the claim's own record of a dead lease, never a worker report.
if code is null or not (code = any (private.sheet_worker_codes()))
or code = 'verification.worker.lease_expired' then
raise exception 'invalid_input' using errcode = 'P0001';
end if;
select r.* into v_review from public.anatomical_sheet_reviews r where r.id = review_id for update;