Repository navigation
Commit 13fbfa2
committed
Fix the named-sender rule: no regex blow-up, no lost link lures
A review of 9d77391 found three faults.
The "this is Dana from" pattern let spaces sit inside the name class and
around it, so a text of "this is" plus 16,000 spaces took 72 seconds to
score, against the screener's 5-second budget. Each name word is now its
own run of letters, so spaces can't be split more than one way.
The brand-prefix pattern took up to 39 characters of anything before the
first colon. "Are you free Saturday at 3:30? Reply STOP" read as a brand,
and so did a mid-text https: link, tel:, "Valued customer:", "Alert:",
"Hiya:" and "Quick question:". The colon must now be followed by a space,
the name must be at most five capitalized words (digits and connectors
like "of" and "&" allowed), and its first word can't be a greeting or a
notice word. "7-Eleven:", "24 Hour Fitness:" and "[Lakeside Clinic]"
count as names now; they didn't before.
The footer was skipped whenever no keyword pattern hit, even when a link,
shouting, a callback number or reply bait had already scored. A branded
smish with a suspicious link dropped from 70 to 30, under the default
bar. The footer now counts next to any other signal, so the only texts
that score differently from v1.10.0 are named senders whose footer is
their only signal. The signals are worked out before the pattern block
and scored in the same order as before, so reasons keep their order.
IMC 2025 recall: all 0.1206 (was 0.1204), en 0.1611 (was 0.1603),
precision 1.0.
Tests: four new SmsContentAnalyzerTest cases (any other signal brings the
footer back, a time/link/notice word isn't a name, digit/connector/bracket
names are, and a timing guard on long runs of spaces). No existing test
changed. Ten mutants of the new rules were all killed.1 parent 2448d31 commit 13fbfa2
4 files changed
Lines changed: 144 additions & 28 deletions
File tree
- app/src
- main/java/com/sysadmindoc/callshield/data
- test/java/com/sysadmindoc/callshield/data
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
519 | 519 | | |
520 | 520 | | |
521 | 521 | | |
522 | | - | |
| 522 | + | |
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
527 | | - | |
| 527 | + | |
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
| |||
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
564 | | - | |
| 564 | + | |
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | | - | |
| 160 | + | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
177 | 211 | | |
178 | 212 | | |
179 | 213 | | |
| |||
418 | 452 | | |
419 | 453 | | |
420 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
421 | 468 | | |
422 | 469 | | |
423 | 470 | | |
| |||
433 | 480 | | |
434 | 481 | | |
435 | 482 | | |
436 | | - | |
| 483 | + | |
437 | 484 | | |
438 | 485 | | |
439 | 486 | | |
440 | 487 | | |
441 | 488 | | |
442 | 489 | | |
443 | 490 | | |
444 | | - | |
445 | | - | |
| 491 | + | |
446 | 492 | | |
447 | 493 | | |
448 | 494 | | |
449 | 495 | | |
450 | 496 | | |
451 | 497 | | |
452 | | - | |
| 498 | + | |
453 | 499 | | |
454 | 500 | | |
455 | 501 | | |
456 | 502 | | |
457 | 503 | | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
| 504 | + | |
462 | 505 | | |
463 | 506 | | |
464 | 507 | | |
465 | 508 | | |
466 | 509 | | |
467 | 510 | | |
468 | | - | |
| 511 | + | |
469 | 512 | | |
470 | 513 | | |
471 | 514 | | |
472 | 515 | | |
473 | | - | |
| 516 | + | |
474 | 517 | | |
475 | 518 | | |
476 | 519 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
785 | 785 | | |
786 | 786 | | |
787 | 787 | | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
788 | 859 | | |
789 | 860 | | |
790 | 861 | | |
| |||
0 commit comments