Skip to content

feat(moment): 動態打分改用專用模型(fallback 短內容,零停機)#4860

Merged
mashbean merged 1 commit into
developfrom
feat/moment-spam-dedicated-endpoint
Jun 19, 2026
Merged

feat(moment): 動態打分改用專用模型(fallback 短內容,零停機)#4860
mashbean merged 1 commit into
developfrom
feat/moment-spam-dedicated-endpoint

Conversation

@mashbean

Copy link
Copy Markdown
Contributor

背景

共用短內容模型對動態(moment) ~90% 華語誤殺(把散文/詩/貓咖/政治時評打 1.0)。已重訓專用動態模型(label-fix,e5+head),699 筆非訓練集 held-out(subagent 真標籤)實測:

門檻 舊共用短內容模型 新專用動態模型
@0.5 誤殺95.5%/召回69% 誤殺2.5%/召回97.8%
@0.7 誤殺93.9%/召回67% 誤殺0.8%/召回92.7%

改動(比照 #4838 留言拆專用)

  • environment.ts:加 momentSpamDetectionApiUrlMATTERS_MOMENT_SPAM_DETECTION_API_URL
  • momentService.detectSpam:改用專用 endpoint,未設定時 fallback 短內容模型 → 零停機 opt-in
  • .env.example 補上

啟用

ops 設 MATTERS_MOMENT_SPAM_DETECTION_API_URL 指向已部署的 prod 動態 endpoint(stack moment-spam-model-service)即啟用。未設定則行為不變。

注意:動態實際處置仍以 ring 行為訊號為主(影子週 06-24 報告後決定);本模型分數讓動態打分變可信、作為輔助訊號。

🤖 Generated with Claude Code

…short-content)

短內容共用模型對動態 ~90% 華語誤殺;專用動態模型重訓後驗收 @0.7 誤殺0.8%/召回93%
(vs 舊 93.9%/67%)。比照 #4838 留言拆專用:momentService.detectSpam 改用
momentSpamDetectionApiUrl,未設定時 fallback 短內容模型 → 零停機 opt-in。
ops 設 MATTERS_MOMENT_SPAM_DETECTION_API_URL 指向新 endpoint 即啟用。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mashbean mashbean requested a review from a team as a code owner June 19, 2026 07:46
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.77%. Comparing base (915098c) to head (463e728).
⚠️ Report is 41 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4860      +/-   ##
===========================================
- Coverage    72.93%   72.77%   -0.17%     
===========================================
  Files         1068     1071       +3     
  Lines        21541    21306     -235     
  Branches      4802     4657     -145     
===========================================
- Hits         15712    15505     -207     
+ Misses        5347     5324      -23     
+ Partials       482      477       -5     

☔ 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.

@mashbean mashbean merged commit e77d8a2 into develop Jun 19, 2026
5 checks passed
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