Skip to content

chore: back-merge master → develop (dedup #4852 prod cherry-picks)#4854

Open
mashbean wants to merge 4 commits into
developfrom
chore/backmerge-master-after-4852
Open

chore: back-merge master → develop (dedup #4852 prod cherry-picks)#4854
mashbean wants to merge 4 commits into
developfrom
chore/backmerge-master-after-4852

Conversation

@mashbean

Copy link
Copy Markdown
Contributor

目的(git hygiene,延續 #4850

#4852 將三層告警 curated cherry-pick 上 master 生產後,master 又多出 3 個 develop 沒有的 commit(內容與 develop 經 #4851 進來的相同,但 hash 不同)。若不處理,下次七日書批次 develop→master 發布會與這些 cherry-pick 衝突/產生重複歷史。

本 PR back-merge master → develop,使 master 重新成為 develop 的祖先,去重 lineage。與 #4850 同樣手法。

內容

  • 唯一衝突:src/connectors/commentService.tsCampaignService import——masterdeploy(comment-spam): 3-tier telegram alerting to prod (notify-only, curated) #4852 解衝突時)丟掉了它,但 develop 的七日書(campaign discussion)在 commentService.ts:707 用到它。保留 import
  • 三層告警相關檔案兩邊內容相同,無實質差異。
  • 已驗證:合併後 master 為祖先;七日書檔案(putQuote.ts 等)完整未被影響。

無新增程式碼,純 lineage 合併。

🤖 Generated with Claude Code

mashbean and others added 4 commits June 16, 2026 18:53
…ify-only)

A high spam score alone can't separate true spam from false positives: on
matters_prod (7-day, >=0.94 band) precision is only ~60% — escort ads (0.996)
score the same as 中文 creative writing (0.992) and short genuine replies.
Account age doesn't separate either (an escort account was 818d old / 883
articles). What cleanly partitions them (ZERO false positives on the real
high-score set) is a compound gate:

  Tier A (auto):   score>=threshold AND contact-channel AND solicitation-keyword
                   → escort / paid-services / account-selling / betting promo.
  Tier B (ring):   author repeats near-identical content across comments.
  Tier C (review): high score but neither → surface to humans, never auto-act
                   (creative writing / opinions / replies land here).

This wires the gate into detectSpam and surfaces all three tiers to the admin
Telegram chat by reusing the existing report-alert SQS → reportTelegramAlert
pipeline (new source 'spam_detection'). NOTIFY-ONLY: it never hides a comment —
auto-action stays behind the separate, still-off commentSpamAutoCollapse flag —
so we validate the gate's precision in production before enabling enforcement.
Gated by MATTERS_COMMENT_SPAM_ALERT (default off).

Signal logic lives in a pure, fully unit-tested module (commentSpamSignals.ts);
the ring check is one bounded read of the author's recent comments, run only for
the rare high-score comments.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The ring near-duplicate check only stripped bare digits, so a rotated contact
token (sk3826, abc123) left a letter remnant (sk, abc) and otherwise-identical
spam templates failed to match. Drop whole alphanumeric tokens containing a
digit instead — the IDs/phone numbers spammers rotate — while keeping pure-letter
words so English templates still ring-match. Fixes the two failing ring tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…prod

deploy(comment-spam): 3-tier telegram alerting to prod (notify-only, curated)
…ter-after-4852

# Conflicts:
#	src/connectors/commentService.ts
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.68%. Comparing base (b12c8b7) to head (97e235d).
⚠️ Report is 22 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4854   +/-   ##
========================================
  Coverage    72.68%   72.68%           
========================================
  Files         1068     1068           
  Lines        21246    21246           
  Branches      4641     4641           
========================================
  Hits         15442    15442           
  Misses        5325     5325           
  Partials       479      479           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant