Skip to content

chore: delete dead features (channel hits, Wrapped, chat agent, inline, VK crosspost) - #369

Merged
ohld merged 1 commit into
productionfrom
chore/delete-dead-features
Oct 30, 2026
Merged

ohld merged 1 commit into
productionfrom
chore/delete-dead-features

Conversation

@ohld

@ohld ohld commented Oct 30, 2026

Copy link
Copy Markdown
Member

Occam's razor pass: delete code with no live traffic or permanently-off flags. Net −6,918 lines (68 files, +32 / −6,950). No migrations, no table drops.

What was deleted

Area Removed Evidence Lines
Channel hits + membership sync (audit #1) recommendations/channel_hits.py, tgbot/channel_workers.py, tgbot/channel_membership.py, tgbot/repo/channel_membership.py, handlers/chat/channel_membership.py, hooks in next_message.py, channel-hit exclusion clauses in broadcast_pick.py (channel-viral pick is off anyway), lifecycle collector in stats_collector.py, 3 scripts, CHANNEL_HITS_ENABLED / CHANNEL_MEMBERSHIP_SYNC_ENABLED, 5 test files both flags False; channel_hits_v1 killed; channel_lifecycle_event 0 rows/30d ~3,000
Wrapped, April 2026 (#4) handlers/stats/wrapped*.py, /wrapped, /wrapped_clear, wrapped_* callbacks, ?start=wrapped branch, auto-trigger popup, redis.get/set_user_wrapped, stats.get_meme_descriptions_for_wrapped, scripts/broadcast_wrapped.py user_wrapped has 0 rows ever; one-off seasonal feature ~1,600
Group chat agent (#5) handlers/chat/agent/, chat/ai.py, chat/explain_meme.py, mention-trigger and fallback in chat/chat.py, agent-gated group onboarding in chat_member.py, chat-agent Sentry filters, CHAT_AGENT_ENABLED, DEEPSEEK_* CHAT_AGENT_ENABLED=False; chat_agent_usage 0 rows/30d (last 2026-09-14) ~800
Inline search (owner) + inline-share canary (#13) handlers/inline.py, repo/inline_search.py, inline handlers, popup.inline_search, inline.yml; share-button variant/assignment, TELEGRAM_INLINE_SHARE_* flags. The share button is now always the URL share 37 searches / 2 chosen in 30d; canary ended 2026-06-25 at 0% ~550
VK crossposting (owner) crossposting/vk.py, VK branch in the RU post flow, VK_USER_TOKEN, VK_GROUP_ID silent since 2026-10-05; 1 click ever ~150
post_share_max_* manual flows (owner) both flows and their deployments May 2026 experiment; manual trigger only ~120
upload_promo_day1 popup split (owner) experiment branch + localization split was broken (135 vs 5,087) ~45
/prefect/* proxy endpoints (#11) /prefect/flow-runs, /prefect/deployments, PREFECT_AUTH_STRING setting (the compose env var is still used by Prefect itself) built for Paperclip; no callers ~90
Dead stubs (#14) commented explain_meme handlers, # @flow in rewards/daily.py, unregistered broadcast_next_meme_to_active_more_than_days_ago + its query, stub uv.lock, empty [tool.poetry.dependencies] dead text ~60
Deps openai-agents no imports left —

Ops (#18): ghost-user monitor cron changes from * * * * * to */10 * * * *. Its 25-minute trailing window still overlaps between runs, so ghosts are still reported.

Kept on purpose:

  • Table definitions in src/database.py, so autogenerate does not emit drops.
  • str-Enum members such as Channel.VK_GROUP_RU and TrxType.BOT_REPLY_PAYMENT.
  • Group message log, +N burger sends, random reactions, and the group like/dislike callback, which still serves old buttons.

Tables now unused (drop later in a separate migration)

user_channel_membership, channel_lifecycle_event, user_wrapped, chat_agent_usage, inline_search_logs, inline_search_chosen_result_logs.

Not done here (left for follow-ups)

Expected merge conflicts

They are trivial and all in import blocks or adjacent lines:

Verification

  • A grep for every removed symbol across src scripts tests static alembic docker-compose*.yml justfile .env.example requirements finds no hits (PREFECT_AUTH_STRING remains only as a compose env var).
  • With requirements/dev.txt installed and no openai-agents, import scripts.serve_flows, import src.main and src.tgbot.app.setup_application() all succeed (52 handlers registered).
  • pytest -x -q: 726 passed, 2 skipped, run against a throwaway local Postgres 14 + Redis, with migrations run from scratch.
  • ruff check src/ tests/ and ruff format --check are clean.

@ohld
ohld force-pushed the chore/delete-dead-features branch from 6d10e1e to d95420a Compare October 30, 2026 17:44
…e search, VK crosspost)

Occam's razor pass over code with no live traffic or permanently-off flags:

- channel-hits + membership sync stack, lifecycle collector, scripts, flags
- Wrapped (April 2026): handlers, commands, popup, redis helpers, script
- group chat agent (DeepSeek/openai-agents), explain_meme, agent Sentry filters
- inline search mode + inline-share canary (share button is URL-only)
- VK crossposting, post_share_max manual flows + share-max picker/query (score_version=3)
- /prefect/* proxy endpoints, commented handlers, # @flow stubs,
  unregistered broadcast flow, broken upload_promo_day1 popup split
- ghost-user monitor cron: every minute -> every 10 minutes
- drop openai-agents dependency, empty uv.lock and poetry stub

Tables are kept in src/database.py (no migration); drop them later.
@ohld
ohld force-pushed the chore/delete-dead-features branch from d95420a to 157c195 Compare October 30, 2026 17:49
@ohld
ohld merged commit 5d5de4f into production Oct 30, 2026
2 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