Escalate repeat sends across groups and delete earlier copies (#124) #43
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
backmeupplz/jev_antispam_bot!43
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/124-repeat-send-escalation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ticket: https://agentboard.icefish-betta.ts.net/#124. This implements Nikita's decision (Telegram 23476): repeat-send escalation in the bot, with no retrain and no keyword rule.
What changes
src/repeat-sends.tsadds normalization: NFKD, lowercase, dropping invisible characters and marks, folding lookalike letters, and stripping punctuation and emoji. Copies are keyed by actor+content (sha256) and scored with1 − (1 − p) × 0.5^n, wherencounts the same account's other copies within 24 h in any group. The floor is p ≥ 0.5 and the minimum is 30 normalized chars. It ships aMemoryRepeatStore(default and tests), a bounded fail-openPostgresRepeatStore(migration007_repeat_sends.sql, content-free rows, 24 h×2 prune, 100k cap, 250 ms deadline), and in-memory audit snapshots for earlier copies.src/bot.ts: after classification, eligible copies are recorded. Once the effective score crosses the unchanged gate (or the model deletes), the current copy and the account's unhandled earlier copies are deleted, in this group and every other group. Each goes through the normal audit-report and stats path (rule: "repeat_send"). Handled copies are never retried. Edits keep their copy. A single send behaves exactly as before.src/deletion.tsnow awaits its callbacks so the handled state is persisted before the next copy.src/index.tswires the Postgres store and closes it on shutdown.spam-cache.tsadds the new file to the policy digest.docs/repeat-sends.md(rule, constants and the log data behind them) and a README paragraph.Data (content-free logs, 2026-10-13 15:19 to 2026-10-14 14:39 UTC)
Tests
bun run checkwith the CI-style Postgres passes: 543 pass, 253 skip, 0 fail.crypto-trade-couriercontrols sent once are untouched;Not proven live: the real-account Telegram deletion and the actual sender of msgs 34977 and 34979.