从 X 推文抓取 到 飞书通知,把卫星 Agent 的 10 步全部跑了一遍。每步先解释"做什么",给出 2-4 个选项让用户决定怎么跑,跑完汇报"结果"和"判断"。本页同时是 data-pipeline-walkthrough skill 的介绍门户 — 把 SKILL.md 的 SOP、6 份归档 md、5 个 follow-up bug 候选全部铺开。
launchd 03:00 daily 在 Step 2 那一段每日触发, Step 1 是 operator 手动触发(单次 30-60 分钟,不挂同一条链)。
expert/X/x_agent scrape 用 cookies 抓 47 家种子公司最新推文进 x.sqlite3。撞 X 429 后 sleep 900s, 全量 30-60 分钟。launchd 是 daily 但只调 ingest, scrape 由 operator 手动触发。# 试水: SpaceX + elonmusk, 每账号 30 条
/Users/john/InvesResearch/agent/scripts/run_x_scrape.sh \
--only SpaceX elonmusk --tweets-per-account 30
| 账号 | 跑前推文 | 跑后推文 | 增量 | 最新 |
|---|---|---|---|---|
| SpaceX | 55 | 57 | +2 | 2026-06-03 17:49 |
| elonmusk | — | — | N/A | 不在 SEED |
--only 只匹配 SEED_COMPANIES, elonmusk 不在 list (那是公司账号清单) 被静默忽略 — 这是个产品级 follow-up #1。
x.sqlite3 流式读最近 500 条推文 → reply/retweet 过滤 → ontology 词典 103 词匹配打 thread+impact → 按 event_id 哈希去重 → 写 agent.db.events。这一段就是 launchd 03:00 daily 跑的链路。# 完全等价 cron (job 内部封装 x-sqlite source) X_SQLITE_PATH=/Users/john/InvesResearch/expert/X/data/x.sqlite3 \ /usr/bin/python3 -m satellite_agent.cli job run x-ingest-daily
| 指标 | 值 | 说明 |
|---|---|---|
| fetched_rows | 500 | 从 sqlite 拉了 500 行 |
| filtered_reply | 19 | reply 过滤 |
| filtered_retweet | 128 | retweet 过滤 |
| emitted | 353 | 喂给 classifier |
| ingested | 0 | 新写入 events |
| duplicates | 353 | event_id 哈希命中 |
| events 总数 | 376 → 376 | 无变化 |
ingested=0 / duplicates=N 不是 bug, 是 "x.sqlite3 没新增" 的真实信号。
fetch --source CLI 不支持 x-sqlite, 只能走 job run x-ingest-daily 间接调 — 这是 follow-up #2。/usr/bin/python3 -m satellite_agent.cli decision \ --view both --window 7 --format md
| 项 | 值 |
|---|---|
| 窗口 | 2026-06-02 → 06-09 (7 天) |
| 窗口内事件数 | 0 · 最近事件都在 6/2 之前 |
| 5 主线本周评分 | 全 +0.00 (窗口空) |
| 上周回看 | 核心网 +2.25 / 运营支撑 +1.00 / 芯片 -0.80 / 终端 -0.10 |
| 仓位调节 | 核心网/运营支撑=减, 终端/芯片/运载=持 |
| 公司位势矩阵 | 完整 4 主线 × 12 公司 composite 排名 |
归档 → agent/reports/walkthrough-2026-06-09/03-decision-both-7d.md · 148 行
thesis --refresh 重算 5 主线 thesis_state baseline 并写库。建议 30 天窗口建初始 baseline, 否则 7 天太短常为 0。/usr/bin/python3 -m satellite_agent.cli thesis --refresh --window 30
| 主线 | thesis 分 | 资金净流(亿) | 事件数 | 方向 |
|---|---|---|---|---|
| 核心网 | 3.25 | +2.4 | 4 | 增强 |
| 终端 | 0.95 | +3.8 | 5 | 增强 |
| 芯片 | 1.20 | 0.0 | 3 | 增强 |
| 运营支撑 | 0.05 | 0.0 | 2 | 增强 |
| 运载发射 | 0.00 | 0.0 | 0 | — |
--llm 版走 LiteLLM 调真模型。本次无 .env 走规则版。# 30 天窗口跑 3 条
for t in 核心网 终端 芯片; do
/usr/bin/python3 -m satellite_agent.cli debate \
--thread "$t" --window 30 --format md
done
| 主线 | 事件 | Bull | Bear | margin | 裁决 | 置信度 × |
|---|---|---|---|---|---|---|
| 核心网 | 4 | 5.65 | 0.00 | +5.65 | 看多 | 1.30 |
| 终端 | 5 | 6.50 | 2.75 | +3.75 | 看多 | 1.12 |
| 芯片 | 3 | 2.00 | 1.30 | +0.70 | 分歧 | 0.96 |
trigger set/check 给主线挂硬阈值, 命中即写 alerts 表; alerts 查询窗口内已有警报(风险维度 events + trigger 写的)。本次现场挂一个 demo trigger 走完整链路, 跑完即删避免污染生产。# 挂 → check → alerts → delete satagent trigger set --thread 核心网 --type thread_sentiment_below \ --params '{"thread":"核心网","threshold":1.0,"window":7}' --severity med satagent trigger check # 立即扫描 satagent alerts --window 30 satagent trigger delete --thread 核心网 --type thread_sentiment_below
| 项 | 值 |
|---|---|
| trigger | 核心网 thread_sentiment_below threshold=1.0 |
| check 触发 | 本窗口 sentiment +0.00 < 1.00 → 触发 ⚠ 假警报 |
| alerts 30 天 | 2 条历史风险事件 (id=5 海格芯片推迟, id=7 海事供应商被调查) |
| 清理 | trigger delete ✓ · 已清空 |
thread_sentiment_below 看的是 7 天窗口内 events 实时 sentiment, 而 不是 thesis_state.score。窗口空 (无新 events) 时 sentiment=0 必触发, 即使 thesis_state.score = 3.25 (核心网真实状态健康)。生产环境如果挂了这个 trigger, 每天 03:00 cron 跑一次, 窗口一空就报警一次 — 完全是噪声。
thesis_state.score(持久化的主线判断)或加 min_events 兜底(窗口内事件数 < N 时不触发)。已纳入 follow-up #3 [最高优先级]。
/usr/bin/python3 -m satellite_agent.cli validate --format md
| 字段 | exact | partial | mismatch | n/a | exact_rate | partial_score |
|---|---|---|---|---|---|---|
| threads | 26 | 16 | 29 | 25 | 37% | 48% |
| thesis_impact | 53 | 0 | 43 | 0 | 55% | 55% |
| strategy | 51 | 0 | 45 | 0 | 53% | 53% |
| thread_in_focus | 33 | 0 | 36 | 27 | 48% | 48% |
| Overall (≥3 字段 exact) | 26 / 96 | — | — | — | 27% | V1 目标 ≥ 50% |
| 排名 | 字段 | 次数 | agent → gt | hint |
|---|---|---|---|---|
| 1 | strategy | ×18 | 观察 → 进入 | 启发式太保守 |
| 2 | thesis_impact | ×17 | 中性 → 增强 | 漏判正向 |
| 3 | thesis_impact | ×17 | 增强 → 中性 | 错判正向 |
归档 → agent/reports/walkthrough-2026-06-09/07-validate.md · 详细 96 行对照表
/usr/bin/python3 -m satellite_agent.cli report --window 30
| 项 | 值 |
|---|---|
| 窗口 | 2026-05-10 → 06-09 (30 天) |
| 事件数 | 8 |
| 5 主线净分 | 核心网 3.25 / 芯片 1.20 / 终端 0.95 / 运营支撑 0.05 / 运载发射 0.0 |
| 风险预警 | 2 条 (海格芯片推迟 + 海事终端被调查) |
| 被点名公司 | 6 家 (中国卫通 / 震有 / 上海瀚讯 / 华力创通 / 海格 / 复旦微电) |
| 下周跟踪清单 | 9 项 (D2C 标准 / 信关站招标 / 射频芯片量产 / ...) |
notify-test --webhook ... --card 发测试卡片到飞书自定义机器人 webhook。验证 EH-3 飞书送达链路。卡片底部强制带"不构成投资建议"免责声明。satagent notify-test \ --webhook 'https://open.feishu.cn/open-apis/bot/v2/hook/XXX' \ --card
.env (gitignored) → 程序 readenv → 注入。notify.py 当前不支持签名模式, 是 follow-up #4。
skills/data-pipeline-walkthrough/SKILL.md (383 行 SOP) + skill.html (321 行 skill 介绍页) + agent/reports/walkthrough-2026-06-09/ 6 份 md (硬证据) + 本网页 walkthrough.html (用户视角全程门户)。corpus v2.0 (96 sample) = 全球 30 + wiki/timeline 抽 70, 跨 5 主线全覆盖 (运载发射 31 首次大规模 ground truth)。规则版 V1.1 在扩 corpus 后从 60% 跌到 27%, 是因为之前 10 sample 的 corpus 不够暴露盲点。
27% 不是退化, 而是更诚实的 baseline。它精准量化了规则版的 3 个盲点 (strategy 太保守 / impact 双向误判), 给 D V2 LLM compare 提供了可对比的对照面。
skills/data-pipeline-walkthrough/agent/reports/walkthrough-2026-06-09/类型: process (流程类) · 不是某一类问题的回答器, 而是把一条固定但需要决策的多步骤流程脚本化。
核心价值: 用户说"逐步跑一遍" 时, Claude 不会瞎跑 — 每步先解释 + 给选项, 用户拍板后再执行, 跑完汇报。
沉淀格式: 与现有 expert-wiki-ingest skill 同形 — SKILL.md 当 SOP + skill.html 当介绍页。
用户说以下任一句话, skill 自动激活:
SKILL.md §1 列了完整 trigger 模式 + 不该激活的反例。
每 30 / 90 天复跑本 skill, 比对硬证据:
diff agent/reports/walkthrough-2026-06-09/ agent/reports/walkthrough-2026-09-09/overall_exact 必须 单调不降, 否则规则版退化警告--only 不在 SEED_COMPANIES 时无 warn 日志。用户以为跑了, 实际被静默忽略。
fetch --source CLI 不支持 x-sqlite, 只能走 job run x-ingest-daily 间接调。手工调试时需要额外封装。
thread_sentiment_below 用 7 天窗口内 events 实时 sentiment 而非 thesis_state.score。窗口空时 sentiment=0 必触发, 即使 thesis 在 3.25。生产环境每天 03:00 cron 会噪声报警。
notify.py 当前只支持无签名 webhook 模式。安全性低于飞书签名校验模式。
规则版盲点已凿实, 留 D V2 真 LLM compare follow-up。用户填 .env LLM key 即可跑 validate --compare-llm 拉对比报告。