feat(supabase): retry delay of 2, 5, 10, 20 s for technical verification failures

M6 amended in place (applied only to the throwaway sandbox): a hidden
not_before on the round, set by fail_sheet_verification and honoured by the
claim; RPC signatures unchanged. pgTAP 021 (68), sandbox cases i (delay with
the real worker), j (inputs at the caps, 2 MiB base), k (just beyond).
This commit is contained in:
bchanot committed 2026-11-01 21:09:00 +01:00
1 parent e967ce6736
commit 5adad3709f
8 files changed
+398 -29

No files matched your search

+10 -1
View File
@@ -267,6 +267,14 @@ unchanged.
worker stops (as the avatar loop). A dead lease (10 minutes) is claimed
again as `verification.worker.lease_expired`; the fifth attempt closes the
round `verification_failed` / `unavailable`.
- Retry delay (owner decision 2026-11-01): a failure reported by
`fail_sheet_verification` makes the round claimable again after 2 s, 5 s,
10 s, 20 s (after attempts 1 to 4), kept in SQL (`not_before`, hidden from
the API roles), so the worker never sleeps for it and the claim of another
round is not blocked; the effective delay is that delay plus up to one poll
interval (`WORKER_POLL_SECONDS`, 2 s). A verdict (failed or not) is never
retried; a dead lease is claimed again at once. The worker code is the
same as before.
- Measured (2026-11-01): the at-caps document (64 views, 1 024 annotations,
8 192 nodes) verified in 185 ms by the worker on the sandbox, verdict
24 689 bytes; the equine draft in about 60 ms.
@@ -369,7 +377,8 @@ docker run --rm --read-only --cap-drop ALL --security-opt no-new-privileges:true
-e SUPABASE_SERVICE_ROLE_KEY="$(pnpm -s supabase status -o env | sed -n 's/^SERVICE_ROLE_KEY="\(.*\)"/\1/p')" \
faunosteo_worker:dev run
pnpm --filter @faunosteo/supabase test:e2e # real-stack end-to-end (needs the worker above)
pnpm e2e:avatar # scripts/avatar-e2e.sh: the three lines above in one, worker started with a 5 s sweep and no quarantine grace
pnpm e2e:avatar # scripts/avatar-e2e.sh: the three lines above in one, worker started with a 5 s sweep and no quarantine grace (DEV: the owner's call)
pnpm db:sandbox avatar-e2e # the same suite and worker on the throwaway stack (SUPABASE.md §5.1): the check of a storage or worker change
```
`docker compose --profile worker up worker` runs the same container from