[PR #7721] Chat filter: ignore allow lines with no letters #7786

Open
opened 2026-11-03 07:24:07 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7721
Author: @ClickingMaster
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/chat-filter-empty-allow


📝 Commits (1)

  • 2d18714 Chat filter: ignore allow lines with no letters

📊 Changes

2 files changed (+13 additions, -1 deletions)

View changed files

📝 crates/horizon-chat-filter/src/lib.rs (+5 -1)
📝 crates/horizon-chat-filter/src/tests.rs (+8 -0)

📄 Description

🤖 Opened by ClickingMaster's AI agent (Claude Code, Claude Sonnet 5.5), not by ClickingMaster personally.

Fixes #7664

Cause: Filter::new in crates/horizon-chat-filter/src/lib.rs stored an allow line (!word*) whose word normalises to no letters (!*, !-*, !) as an allow-prefix with empty runs. is_allowed then matches every word, so the filter never flags anything.

Fix: skip allow entries whose normalised runs are empty (same as the slur section already does).

Test: an_allow_line_without_letters_allows_nothing fails before (Filter::new("nigger\n!*").matches("nigger") is false) and passes after; crate tests 16/16.

Self-check

  • cargo fmt --check, clippy -D warnings on horizon-chat-filter, cargo test -p horizon-chat-filter
  • port_ledger check: no ledger built here
  • pr_ready.py not run: no ALSA headers

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/7721 **Author:** [@ClickingMaster](https://github.com/ClickingMaster) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/chat-filter-empty-allow` --- ### 📝 Commits (1) - [`2d18714`](https://github.com/horizon-rust/horizon/commit/2d18714f27deab310c8369924505bea9b15d2b55) Chat filter: ignore allow lines with no letters ### 📊 Changes **2 files changed** (+13 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-chat-filter/src/lib.rs` (+5 -1) 📝 `crates/horizon-chat-filter/src/tests.rs` (+8 -0) </details> ### 📄 Description > 🤖 Opened by ClickingMaster's AI agent (Claude Code, Claude Sonnet 5.5), not by ClickingMaster personally. Fixes #7664 **Cause:** `Filter::new` in `crates/horizon-chat-filter/src/lib.rs` stored an allow line (`!word*`) whose word normalises to no letters (`!*`, `!-*`, `!`) as an allow-prefix with empty runs. `is_allowed` then matches every word, so the filter never flags anything. **Fix:** skip allow entries whose normalised runs are empty (same as the slur section already does). **Test:** `an_allow_line_without_letters_allows_nothing` fails before (`Filter::new("nigger\n!*").matches("nigger")` is false) and passes after; crate tests 16/16. **Self-check** - [x] cargo fmt --check, clippy -D warnings on horizon-chat-filter, cargo test -p horizon-chat-filter - [ ] port_ledger check: no ledger built here - [ ] pr_ready.py not run: no ALSA headers 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#7786
No description provided.