[claude] Fix moderation infinite re-review loop (#27) (#71)

This commit was merged in pull request #71.
This commit is contained in:
2026-03-23 00:44:57 +00:00
parent 42b8826d18
commit 5954a2fdc0
4 changed files with 14 additions and 4 deletions

View File

@@ -0,0 +1,9 @@
-- Migration: Add 'flagged' status to relay_event_queue
-- Fixes infinite re-review loop (#27): AI-flagged events now transition to
-- status='flagged' instead of staying 'pending', so processPending() skips them.
--
-- The status column is plain TEXT (not a Postgres enum), so no ALTER TYPE is
-- needed. This migration adds an index for admin queries on flagged events.
CREATE INDEX IF NOT EXISTS idx_relay_event_queue_status
ON relay_event_queue(status);

View File

@@ -3,7 +3,7 @@ import { nostrIdentities } from "./nostr-identities";
// ── Status + reviewer types ───────────────────────────────────────────────────
export const QUEUE_STATUSES = ["pending", "approved", "rejected", "auto_approved"] as const;
export const QUEUE_STATUSES = ["pending", "approved", "rejected", "auto_approved", "flagged"] as const;
export type QueueStatus = (typeof QUEUE_STATUSES)[number];
export const QUEUE_REVIEWERS = ["timmy_ai", "admin"] as const;