Commit be3d885
committed
fix(review): filter the AI narrative assessment per sentence, not all-or-nothing
FORBIDDEN_PUBLIC_COMMENT_WORDS is matched with a plain case-insensitive
`.includes()` over a list containing ordinary review vocabulary --
"reward", "rewards", "ranking", "rankings", "cohort", "farming",
"reviewability" -- and toPublicSafe drops its WHOLE input when
sanitizePublicComment throws. A safe review of this codebase's own
gate/scoring code ("updates the ranking comparator so ties resolve
deterministically") therefore had its entire narrative discarded and
replaced by the generic "did not include a separate narrative summary"
placeholder.
Observed live across ~40% of reviews. The model's assessment was
confirmed PRESENT in those cases: no `ai_review_missing_assessment`
diagnostic was emitted for the affected PRs, so the text was produced and
then thrown away downstream, and the cached rows carry
`inconclusive: false` (the review succeeded).
Drop only the offending SENTENCE instead. A leaked private VALUE
("trust score 0.82", "reward estimate 12 TAO") necessarily sits in the
same sentence as the term naming it, so removing that sentence removes
the risky content -- discarding the whole assessment protected nothing
additional and cost the reader every other sentence. It also matches how
this file already treats findings: safeBlockers/safeNits filter per item
and keep the survivors, so the assessment was the lone all-or-nothing
holdout. An assessment whose every sentence is unsafe still returns null
and takes the existing placeholder path unchanged.1 parent fb8e2eb commit be3d885
2 files changed
Lines changed: 107 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
677 | 721 | | |
678 | 722 | | |
679 | 723 | | |
| |||
1979 | 2023 | | |
1980 | 2024 | | |
1981 | 2025 | | |
1982 | | - | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
1983 | 2030 | | |
1984 | 2031 | | |
1985 | 2032 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3769 | 3769 | | |
3770 | 3770 | | |
3771 | 3771 | | |
| 3772 | + | |
| 3773 | + | |
| 3774 | + | |
| 3775 | + | |
| 3776 | + | |
| 3777 | + | |
| 3778 | + | |
| 3779 | + | |
| 3780 | + | |
| 3781 | + | |
| 3782 | + | |
| 3783 | + | |
| 3784 | + | |
| 3785 | + | |
| 3786 | + | |
| 3787 | + | |
| 3788 | + | |
| 3789 | + | |
| 3790 | + | |
| 3791 | + | |
| 3792 | + | |
| 3793 | + | |
| 3794 | + | |
| 3795 | + | |
| 3796 | + | |
| 3797 | + | |
| 3798 | + | |
| 3799 | + | |
| 3800 | + | |
| 3801 | + | |
| 3802 | + | |
| 3803 | + | |
| 3804 | + | |
| 3805 | + | |
| 3806 | + | |
| 3807 | + | |
| 3808 | + | |
| 3809 | + | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
| 3813 | + | |
| 3814 | + | |
| 3815 | + | |
| 3816 | + | |
| 3817 | + | |
| 3818 | + | |
| 3819 | + | |
| 3820 | + | |
| 3821 | + | |
| 3822 | + | |
| 3823 | + | |
| 3824 | + | |
| 3825 | + | |
| 3826 | + | |
| 3827 | + | |
| 3828 | + | |
| 3829 | + | |
| 3830 | + | |
3772 | 3831 | | |
3773 | 3832 | | |
3774 | 3833 | | |
| |||
0 commit comments