feat(vordr): auto-flag low-effort top-level comments#3903
Conversation
Adds a pure `isLowEffortComment` filter that runs synchronously on every new top-level comment. When it matches, the comment's vordr flag is set inline through the existing flags mechanism and a counter/log line is emitted so we can monitor the auto-flag rate. Replies and templated squad welcomes are exempt. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Drop dead empty-string entry and duplicate vocab tokens (`deserved`, `damnn`, `goo`) — Set already dedups but the source list shouldn't. - Inline normalize() as a fluent chain; collapse the two length checks into one (0 < 4) and drop the unused `norm`/`words` dual return. - Tighten the resolver wire-in by reusing `commentId` / `content` instead of re-reading them from `createdComment`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
🍹 The Update (preview) for dailydotdev/api/prod (at 295b2d2) was successful. ✨ Neo ExplanationRoutine deployment of a new image adding low-effort comment auto-flagging, with migration jobs cycling to the new commit. ✅ Low RiskThis is a standard application deployment rolling out commit The migration Jobs (both DB and Clickhouse) are being cycled to the new commit hash, which is how this pipeline runs schema migrations on each deploy. No schema changes are visible in the diff, but the migration jobs will run against the new image regardless. 🔵 Info — The Resource Changes Name Type Operation
~ vpc-native-worker-job-deployment kubernetes:apps/v1:Deployment update
+ vpc-native-api-clickhouse-migration-7384d8c9 kubernetes:batch/v1:Job create
~ vpc-native-update-current-streak-cron kubernetes:batch/v1:CronJob update
~ vpc-native-private-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-daily-digest-cron kubernetes:batch/v1:CronJob update
- vpc-native-api-db-migration-798dc603 kubernetes:batch/v1:Job delete
~ vpc-native-clean-zombie-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-hourly-notification-cron kubernetes:batch/v1:CronJob update
~ vpc-native-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-check-analytics-report-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-source-public-threshold-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-profile-analytics-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-trending-cron kubernetes:batch/v1:CronJob update
~ vpc-native-post-analytics-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-channel-digests-cron kubernetes:batch/v1:CronJob update
~ vpc-native-validate-active-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-expire-super-agent-trial-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-profile-updated-sync-cron kubernetes:batch/v1:CronJob update
~ vpc-native-generate-search-invites-cron kubernetes:batch/v1:CronJob update
~ vpc-native-personalized-digest-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-posts-analytics-refresh-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-highlighted-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-temporal-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-calculate-top-readers-cron kubernetes:batch/v1:CronJob update
~ vpc-native-bg-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-user-profile-analytics-history-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-achievement-rarity-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-images-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-user-companies-cron kubernetes:batch/v1:CronJob update
- vpc-native-api-clickhouse-migration-798dc603 kubernetes:batch/v1:Job delete
+ vpc-native-api-db-migration-7384d8c9 kubernetes:batch/v1:Job create
~ vpc-native-clean-expired-better-auth-sessions-cron kubernetes:batch/v1:CronJob update
~ vpc-native-materialize-monthly-best-post-archives-cron kubernetes:batch/v1:CronJob update
~ vpc-native-materialize-yearly-best-post-archives-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-old-notifications-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-opportunities-cron kubernetes:batch/v1:CronJob update
~ vpc-native-rotate-daily-quests-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-stale-user-transactions-cron kubernetes:batch/v1:CronJob update
~ vpc-native-personalized-digest-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-rotate-weekly-quests-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-channel-highlights-cron kubernetes:batch/v1:CronJob update
... and 12 other changes |
Two FPs surfaced during data validation: - '@user welcome as well!!!' (and 'welcome aboard', 'welcome back', …) — the templated-welcome filter was anchored to 'welcome to <X>'. Broaden to 'welcome\\b' so any greeting continuation is exempt. - Comments containing a markdown image/GIF embed (e.g. tenor/klipy GIFs, with or without surrounding text) were being flagged because after URL strip only 'GIF' or trailing junk remained. Add an IMAGE_EMBED guard that exempts any comment containing '' (also tolerates the angle-bracketed URL form ''). Adds Jest cases for both FP classes plus a few collapse-variant positives (Damnnnnnn, Greatt!!!).
|
Pushed
Test suite extended with explicit cases for both classes ( |
Summary
Adds a synchronous
isLowEffortComment(content)check to top-level comment creation. When it returns true, the comment is auto-flagged through the existing Vordrflags.vordrpath (no new column) and a telemetry counter + log line is emitted so we can monitor the rate post-launch.Key decisions
src/common/lowEffortComment.tswith no DB or network dependencies — vocab + normalization rules live in one place for easy tuning.commentOnPost;commentOnComment(replies) is intentionally untouched per the spec.vordr: lowEffort || (await checkWithVordr(...))— same column, same downstream behavior; no schema change.counters.api.vordrcounter withreason: 'low_effort'(consistent withvordr_ip/vordr_word) plus acomment_low_effort_autoflaggedlog line carryinguserId,commentId,postId.Test plan
__tests__/common/lowEffortComment.test.ts— 26 cases covering positive, negative, and edge scenarios from the spec__tests__/comments.tsmutation commentOnPost+vordrintegration suites pass with no snapshot driftpnpm run lintcleanpnpm run buildcleancomment_low_effort_autoflaggedlog volume +vordrcounter (reason=low_effort) post-deploy to tune vocabCloses ENG-1571
Created by Huginn 🐦⬛