feat(crossposting): source-quality ranker + diversity cap (Phase 2)#209
Merged
ohld merged 1 commit intoproductionfrom Apr 28, 2026
Merged
feat(crossposting): source-quality ranker + diversity cap (Phase 2)#209ohld merged 1 commit intoproductionfrom
ohld merged 1 commit intoproductionfrom
Conversation
- specs/crossposting-source-quality.md: Phase 2 ranker iteration spec (CEO + Eng + Codex outside-voice reviewed). Adds per-source quality multiplier from crossposting forwards/views, diversity cap (≤1 post/source/24h), invited_count signal boost, image-only filter. score_version=2. Spec is implementation input for ralphex. - .gitignore: add .worktrees/ — per-developer git worktrees should never be committed (4 active worktrees were dirtying status).
Member
Author
|
STAFF ENGINEER REVIEW: APPROVED — pure docs + gitignore PR. Spec doc + .worktrees/ ignore. /review + /codex review both clean. /cso skipped (no sensitive surfaces touched). One non-blocking note: the spec has two duplicated 'final SQL' blocks with different CI: lint pass, test pending — |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 2 iteration on the channel crossposting ranker — published spec (specs/completed/crossposting-source-quality.md) plus full implementation, tests, and review.
Behavior changes:
AVG(forwards × √(views/100))over mature 30-day crossposting history permeme_source_idPERCENTILE_CONT(0.5)) — set-and-forget, no hardcoded thresholdstelegram_message_id IS NOT NULL)(1 + min(invited_count, 10) × 0.1)— caps at ×2.0 for memes with 10+ user sharesnlikes >= 5) preserved per channel premise: "best of bot, not newest of source"score_version=2tag on new posts → enables clean v1/v2 comparisonProduction correctness fixes (from codex review iters):
src/flows/rewards/uploaded_memes.py: movedlog_meme_sentto afterbot.send_media_groupso reward posts now record realtelegram_message_idand properly participate in the diversity captelegram_message_id IS NOT NULLfilter)log_meme_sentkeepsON CONFLICT DO NOTHINGsemantics — preserves the original mature crossposting sample when reward flows repost an already-crossposted memeGraceful degradation:
Verification
ruff check src/ tests/— cleanruff format src/ tests/— cleanpytest tests/test_crossposting_meme.py— 13/13 pass (4 new ranker tests + 9 existing)Success measurement
After this lands, baseline before next changes:
Re-read at
+14dpost-ship. Pass = v2 ≥ 1.15× v1 forwards on at least one channel + no >10% drop in views. Query in spec.Review trail
/plan-ceo-review— selective expansion mode, scope/strategy/plan-eng-review— architecture, tests, performanceralphex— 4 implementation tasks + 9 codex iterations + 2 claude review roundsTest plan
Post to TG Channel RUflow once, verify a meme posts cleanlyPost to TG Channel ENflow once, verify a meme posts cleanlyDeferred (TODOS)
sc_%) materialized intomeme_statscaption IS NULLmultiplier