test: add rule-case validator for no-reply and 🔚 injection paths

This commit is contained in:
2026-02-25 12:53:45 +00:00
parent 32405fa3e2
commit d2fc8c89dd
3 changed files with 120 additions and 1 deletions

54
docs/rule-cases.json Normal file
View File

@@ -0,0 +1,54 @@
{
"config": {
"enabled": true,
"discordOnly": true,
"bypassUserIds": ["561921120408698910"],
"endSymbols": ["。", "", "", ".", "!", "?"]
},
"cases": [
{
"name": "non-discord skips gate",
"channel": "telegram",
"senderId": "u1",
"content": "hello",
"expect": {
"shouldUseNoReply": false,
"reason": "non_discord",
"injectEndMarker": false
}
},
{
"name": "bypass sender injects end marker",
"channel": "discord",
"senderId": "561921120408698910",
"content": "hello",
"expect": {
"shouldUseNoReply": false,
"reason": "bypass_sender",
"injectEndMarker": true
}
},
{
"name": "ending punctuation injects end marker",
"channel": "discord",
"senderId": "u2",
"content": "你好!",
"expect": {
"shouldUseNoReply": false,
"reason": "end_symbol:",
"injectEndMarker": true
}
},
{
"name": "no ending punctuation triggers no-reply override",
"channel": "discord",
"senderId": "u2",
"content": "继续",
"expect": {
"shouldUseNoReply": true,
"reason": "rule_match_no_end_symbol",
"injectEndMarker": false
}
}
]
}