feat: 完善 signals 热度筛选与展示交互

This commit is contained in:
2026-02-24 17:31:43 +08:00
parent f157174341
commit ff6f12be21
12 changed files with 541 additions and 134 deletions
+46 -4
View File
@@ -17,7 +17,7 @@ Aggregate frontier discussions from multiple platforms, keep only **AI Agent-rel
| Source | Endpoint | Node Type | Extracted Elements |
| --- | --- | --- | --- |
| Hacker News | `https://hacker-news.firebaseio.com/v0/topstories.json` + `.../item/{id}.json` | HTTP Request | `title`, `url`, `text`, `score`, `descendants`, `time` |
| GitHub | `https://api.github.com/search/repositories` | HTTP Request | `full_name`, `html_url`, `description`, `topics`, `stargazers_count`, `pushed_at` |
| GitHub | `https://api.github.com/search/issues` | HTTP Request | `title`, `html_url`, `body`, `comments`, `reactions`, `labels`, `updated_at` |
| arXiv | `https://export.arxiv.org/api/query?...` | RSS Read | `title`, `link`, `content/contentSnippet`, `pubDate/isoDate`, `categories` |
| Reddit | `https://www.reddit.com/r/LocalLLaMA/new.json?limit=40` | HTTP Request | `title`, `permalink`, `selftext/url`, `ups`, `num_comments`, `created_utc` |
| Product Hunt | `https://www.producthunt.com/feed` | RSS Read | `title`, `link`, `content/contentSnippet`, `published/updated` |
@@ -39,7 +39,7 @@ Aggregate frontier discussions from multiple platforms, keep only **AI Agent-rel
The workflow emits payload compatible with `SignalWebhookPayloadSchema`:
- `apiKey`: from `$env.WEBHOOK_API_KEY`
- `apiKey`: manually configured in node `构建 Webhook Payload`
- `signals[]`:
- `source` -> one of:
- `hacker_news`
@@ -48,7 +48,7 @@ The workflow emits payload compatible with `SignalWebhookPayloadSchema`:
- `hugging_face`
- `reddit`
- `product_hunt`
- `sourceUrl`, `title`, `summary`, `topic`, `tags`, `sections`, `engagement`, `publishedAt`, `isActive`
- `sourceUrl`, `title`, `summary`, `topic`, `tags`, `sections`, `engagement`, `hotScore`, `isHot`, `publishedAt`, `isActive`
Sections are constrained to:
@@ -62,7 +62,49 @@ It only decides whether a signal is about AI Agent topics and then structures co
- Keep (`shouldKeep=true`) if discussion is materially agent-related
- Drop (`shouldKeep=false`) if clearly unrelated to AI Agent
- Ambiguous cases bias to keep
- Drop low-discussion or low-value question items (`shouldKeep=false`)
- If information is insufficient, default to drop
## High-Heat GateAI 前硬过滤)
`筛掉占位候选` 节点会在 AI 前做硬性筛选,减少低价值输入:
- source-level minimum engagement:
- `hacker_news >= 35`
- `github >= 8`
- `reddit >= 25`
- source-level freshness window:
- `hacker_news <= 72h`
- `github <= 168h`
- `reddit/arxiv/hugging_face/product_hunt <= 120h`
- low-value question filtering:
- 求助型单问题 + 短摘要 + 低互动,直接丢弃
- per-source candidate capAI 前限流):
- `hacker_news 6`, `github 6`, `reddit 6`, `arxiv 4`, `hugging_face 4`, `product_hunt 4`
- strict keyword gate for low-discussion sources:
- `arxiv/hugging_face/product_hunt` 必须命中 agent 相关关键词(如 `agent`, `agentic`, `multi-agent`, `tool calling`, `mcp`, `智能体`)才进入 AI
## HOT 判定(流程内)
`清洗并映射入库字段` Code 节点会基于**互动量 + 时间新鲜度**计算:
- `hotScore`0-100
- `isHot`:布尔值,用于页面 HOT 标签与排序优先
该判定只衡量讨论热度,不评价观点对错或质量。
## DB 升级(新增 HOT 字段)
由于当前仓库默认忽略 `prisma/migrations/*_*` 目录,建议在数据库手动执行一次:
```sql
ALTER TABLE "signals"
ADD COLUMN IF NOT EXISTS "hotScore" INTEGER NOT NULL DEFAULT 0,
ADD COLUMN IF NOT EXISTS "isHot" BOOLEAN NOT NULL DEFAULT false;
CREATE INDEX IF NOT EXISTS "idx_signal_hot_score" ON "signals"("hotScore");
CREATE INDEX IF NOT EXISTS "idx_signal_active_hot_sort" ON "signals"("isActive", "isHot", "hotScore", "publishedAt");
```
## Manual Configuration (No Env)