fix(ai-moderation): patch structural bypass vulnerabilities in NLP pipeline
- Implement Pre-computation Normalization for Polyglot Obfuscation. - Inject Ontological Graph for literal translation evasion (e.g., 'kostum hewan'). - Enforce Entropy-Triggered Routing to deny softmax fallback exploitation. - Format discord-gateway codebase.
This commit is contained in:
@@ -828,12 +828,10 @@ export async function getConversationKeysWithIncompleteAnalysis(
|
||||
try {
|
||||
const database = db();
|
||||
const rows = await database
|
||||
.selectDistinct<Array<{ thread_id: string | null; channel_id: string }>>(
|
||||
{
|
||||
thread_id: messagesTable.thread_id,
|
||||
channel_id: messagesTable.channel_id,
|
||||
},
|
||||
)
|
||||
.selectDistinct<Array<{ thread_id: string | null; channel_id: string }>>({
|
||||
thread_id: messagesTable.thread_id,
|
||||
channel_id: messagesTable.channel_id,
|
||||
})
|
||||
.from(messagesTable)
|
||||
.where(
|
||||
and(
|
||||
@@ -928,7 +926,6 @@ export async function getIncompleteMessagesByConversation(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Message Reviews CRUD
|
||||
// ====================
|
||||
|
||||
@@ -1307,7 +1304,10 @@ export async function revertStuckProcessingMessages(
|
||||
|
||||
if (Array.isArray(rows) && rows.length > 0) {
|
||||
logger.info(
|
||||
{ count: rows.length, messageIds: rows.map((r: { id: string }) => r.id) },
|
||||
{
|
||||
count: rows.length,
|
||||
messageIds: rows.map((r: { id: string }) => r.id),
|
||||
},
|
||||
"Reverted stuck processing messages back to pending",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
import type fs from "node:fs";
|
||||
import type prism from "prism-media";
|
||||
|
||||
export type AIStatus = "pending" | "processing" | "clean" | "warn" | "flagged" | "error";
|
||||
export type AIStatus =
|
||||
| "pending"
|
||||
| "processing"
|
||||
| "clean"
|
||||
| "warn"
|
||||
| "flagged"
|
||||
| "error";
|
||||
export type AISeverity = "none" | "low" | "medium" | "high" | "critical";
|
||||
export type AIRecommendedAction =
|
||||
| "none"
|
||||
|
||||
Reference in New Issue
Block a user