fix(channel): keep spam out of topic channel feeds#4864
Conversation
72d5d4a to
19b7eba
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4864 +/- ##
==========================================
- Coverage 73.12% 73.12% -0.01%
==========================================
Files 1081 1081
Lines 21644 21641 -3
Branches 4735 4735
==========================================
- Hits 15828 15825 -3
Misses 5339 5339
Partials 477 477 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
19b7eba to
73dd7a6
Compare
|
Hotfix exception approval recorded on 2026-06-21 Asia/Taipei. Reason: production topic channel feeds can expose spam-scored articles, and channel assignment can clear existing spam state. User-facing topic channel surfaces including 生活, 書影音, 時事, and 還有 are affected. SOP evidence:
|
|
Clarification after reviewing publicationService.ts line 627: The automatic post-publication path already computes spam from score before channel classification and returns early when the article is spam, so high-score spam should not be sent to automatic channel classification from that path. The remaining production risks addressed by this PR are narrower and still valid:
This also means historical rows with |
Why
Topic channel feeds could surface spam articles because
findTopicChannelArticlesonly filteredarticle.is_spam, ignoring highspam_scorerows whereis_spamis still null. The channel assignment path also clearedarticle.is_spamto false whenever an article was added or re-enabled in a channel, which could override moderation/model state.This is especially risky after the article spam model was updated and deployed, because high
spam_scoreshould now be honored consistently in channel feeds.What changed
excludeSpammodifier in topic channel article queries, so unpinned channel feeds honor bothis_spamandspam_score >= spam_threshold.article.is_spamwhen assigning topic channels.Production audit SQL
Verification
npm run buildnpm run lintnpx prettier --check src/connectors/channel/channelService.ts src/connectors/__test__/channelService/topicChannel.test.ts src/connectors/__test__/channelService/findTopicChannelArticles.test.tsConnector Jest was attempted but blocked in this local environment because Postgres is not running, no
MATTERS_PG_*env vars are set, and Docker is unavailable. The failure occurs duringgenConnections()setup before test assertions run.