perf: sync protocol and core hardening updates

This commit is contained in:
A 2026-07-11 19:48:26 +08:00
parent 152fed3b87
commit 4390ebf5a9
283 changed files with 29231 additions and 2295 deletions

View file

@ -0,0 +1,10 @@
-- Terminal failed rows are short-lived diagnostic quarantine entries. Cleanup starts from the
-- one-row-per-user durable head so it can lock in the same head→outbox order as claim/completion
-- without scanning healthy lanes.
CREATE INDEX dispatch_outbox_user_heads_failed_cleanup_idx
ON public.dispatch_outbox_user_heads (
updated_at,
target_user_id,
head_id
)
WHERE status = 'failed';