Skip to content

feat: signal deduplication + follower-count influence weighting - #512

Open
essentialbit wants to merge 10 commits into
mainfrom
feat/signal-dedup-influence-weighting-20260725
Open

feat: signal deduplication + follower-count influence weighting#512
essentialbit wants to merge 10 commits into
mainfrom
feat/signal-dedup-influence-weighting-20260725

Conversation

@essentialbit

Copy link
Copy Markdown
Owner

Summary

  • MISSION.md's L2 checklist has listed "Signal deduplication and influence weighting (high-follower accounts)" as an open item since the project's start, and CLAUDE.md's own self-improvement priority order ranks signal quality (filtering/dedup/influence weighting) above dashboard/coverage/performance work -- but no such logic existed anywhere in the ingestion path.
  • twitter_client.py: search_recent() now requests public_metrics on the author expansion (follower count) and computes a bounded [1.0, 3.0] log-scale influence_weight per tweet (0 followers -> 1.0, ~1000 -> ~2.0, capped at 3.0 so no single mega-account can swamp an aggregate). fetch_signals() now dedupes near-identical retweets/quote-tweets of the same viral text within a collection cycle (URL-stripped, whitespace-normalized signature) before they're persisted as N independent signals, and stores followers/influence_weight in the existing metadata JSON blob (no schema migration).
  • trend_detector.py: compute_sentiment_stats() now computes a weight-adjusted average instead of a flat mean, falling back to a neutral weight of 1.0 for any signal (non-Twitter sources included) that carries no influence_weight -- output shape and non-Twitter/no-metadata behavior are both unchanged.

Test plan

  • Standalone verification script against a scratch DB (never the live data/sentinel.db): influence-weight bounds/monotonicity, dedup-signature normalization, an end-to-end mocked fetch_signals() run confirming a near-duplicate retweet is dropped and only 2 of 3 synthetic tweets persist, weighted-vs-unweighted average divergence, and backward-compatible neutral-weight fallback for metadata-less/non-Twitter signals -- all passed.
  • python3 -c "from main import *" import smoke test -- passes.
  • No tests/ directory exists in this repo (documented convention); no persisted test regression here.

🤖 Generated with headless FredAI sensor cycle (Claude Code)

… signals

MISSION.md's L2 checklist has named "Signal deduplication and influence
weighting (high-follower accounts)" as an open item since project inception,
and CLAUDE.md's own step-3 priority order ranks signal quality above
dashboard/coverage/performance work -- but no dedup or weighting logic
existed anywhere in the ingestion path. twitter_client.py now fetches each
author's public_metrics (follower count) and computes a bounded [1.0, 3.0]
log-scale influence_weight per signal, and fetch_signals() dedupes
near-identical retweets/quote-tweets of the same viral text within a
collection cycle (URL-stripped, whitespace-normalized signature) before
they're persisted as N independent signals. trend_detector's
compute_sentiment_stats() now computes a weight-adjusted average instead of
a flat mean, falling back to neutral weight 1.0 for any signal (non-Twitter
sources included) that carries no influence_weight in its metadata --
output shape and non-Twitter behavior are both unchanged.
essentialbit pushed a commit that referenced this pull request Jul 25, 2026
L3-L6 sections were already refreshed on this branch; the top-of-doc L2
section (lines 33-46) was the one part still using original placeholder
bullets despite the L2 Priority queue section further down already
marking all 9 items done. All 10 L2 items verified against real modules
on main; 9 are merged, 1 (signal dedup/influence weighting) is
code-complete on open PR #512 pending merge.
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