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

@@ -4,7 +4,7 @@
-- nothing), technical failures up to the attempt limit with their progressive
-- delay (`not_before`), dead leases.
begin;
select plan(89);
select plan(90);
insert into auth.users (id, email, email_confirmed_at) values
('f0000000-0000-0000-0000-000000000001', 'own@vj.local', now()),
@@ -209,6 +209,8 @@ set local role service_role; select pg_temp.worker();
select is((select count(*)::int from public.claim_sheet_verifications(1)), 1, 'third round claimed');
select throws_ok(format('select public.fail_sheet_verification(%L, %L, %L)', pg_temp.id('r3'), pg_temp.token('r3'), 'verification.worker.oops'),
'P0001', 'invalid_input', 'an unknown worker code is refused');
select throws_ok(format('select public.fail_sheet_verification(%L, %L, %L)', pg_temp.id('r3'), pg_temp.token('r3'), 'verification.worker.lease_expired'),
'P0001', 'invalid_input', 'lease_expired is the claim''s record, never a worker report');
select is(public.fail_sheet_verification(pg_temp.id('r3'), gen_random_uuid(), 'verification.worker.timeout'), 'stale', 'a failure with another token is stale');
select is(public.fail_sheet_verification(pg_temp.id('r3'), pg_temp.token('r3'), 'verification.worker.timeout'), 'retry', 'a timeout below the limit is retried');
select is(pg_temp.status('r3') || '/' || (pg_temp.token('r3') is null)::text, 'verifying/-/verification.worker.timeout/true', 'round stays verifying, code recorded, lease released');