From 84ad40d00a78058608d07e763294ed0c0ec76edd Mon Sep 17 00:00:00 2001 From: Chen Gu Date: Sun, 8 Mar 2026 14:49:10 +0800 Subject: [PATCH] Add daily arXiv digest pipeline and heartbeat push workflow --- HEARTBEAT.md | 19 ++ org/cases/arxiv_digest/README.md | 19 ++ org/cases/arxiv_digest/arxiv_daily_digest.py | 168 ++++++++++++++++++ org/cases/arxiv_digest/output/2026-03-08.md | 39 ++++ org/cases/arxiv_digest/output/latest.md | 39 ++++ .../arxiv_digest/state/latest_state.json | 32 ++++ 6 files changed, 316 insertions(+) create mode 100644 org/cases/arxiv_digest/README.md create mode 100755 org/cases/arxiv_digest/arxiv_daily_digest.py create mode 100644 org/cases/arxiv_digest/output/2026-03-08.md create mode 100644 org/cases/arxiv_digest/output/latest.md create mode 100644 org/cases/arxiv_digest/state/latest_state.json diff --git a/HEARTBEAT.md b/HEARTBEAT.md index 4b6ec1e..d2ad30e 100644 --- a/HEARTBEAT.md +++ b/HEARTBEAT.md @@ -23,3 +23,22 @@ - 需要主动触达时:直接给用户发送自然消息,不要输出 HEARTBEAT_OK。 - 若本轮不需要触达:回复 HEARTBEAT_OK。 + +--- + +## 每日 ArXiv 简报任务(新增) + +目标:每天自动产出并推送一条“最新+热度”论文简报给谷老板。 + +执行规则: +1. 每天 09:30 之后(且 23:00 前),若今日尚未推送,则运行: + - `python3 /Users/guchen/.openclaw/workspace/org/cases/arxiv_digest/arxiv_daily_digest.py` +2. 读取生成文件: + - `/Users/guchen/.openclaw/workspace/org/cases/arxiv_digest/output/YYYY-MM-DD.md` +3. 用聊天口吻给谷老板推送: + - 今日 Top3 热点论文(标题+一句话) + - 1 条 Val 建议 +4. 推送完成后写入状态文件: + - `/Users/guchen/.openclaw/workspace/org/cases/arxiv_digest/state/last_push.json` + - 内容至少包含 `{ "date": "YYYY-MM-DD", "pushed": true }` +5. 同一天不重复推送;若脚本失败,发一条简短异常提示并稍后重试。 diff --git a/org/cases/arxiv_digest/README.md b/org/cases/arxiv_digest/README.md new file mode 100644 index 0000000..0f27103 --- /dev/null +++ b/org/cases/arxiv_digest/README.md @@ -0,0 +1,19 @@ +# ArXiv Daily Digest (Val) + +## What it does +- Fetches latest arXiv papers for: cs.AI/cs.LG/cs.CL/cs.CV/cs.RO/stat.ML +- Ranks "hot" papers with a practical score (recency + keyword signal + HN mention proxy + code hint) +- Produces daily markdown brief + +## Run +```bash +python3 /Users/guchen/.openclaw/workspace/org/cases/arxiv_digest/arxiv_daily_digest.py +``` + +## Output +- Daily brief: `output/YYYY-MM-DD.md` +- Latest mirror: `output/latest.md` +- Runtime state: `state/latest_state.json` + +## Notes +- Hotness is heuristic (v1). Can be upgraded with stronger social/citation signals later. diff --git a/org/cases/arxiv_digest/arxiv_daily_digest.py b/org/cases/arxiv_digest/arxiv_daily_digest.py new file mode 100755 index 0000000..b1e880f --- /dev/null +++ b/org/cases/arxiv_digest/arxiv_daily_digest.py @@ -0,0 +1,168 @@ +#!/usr/bin/env python3 +import datetime as dt +import json +import re +import urllib.parse +import urllib.request +import xml.etree.ElementTree as ET +from pathlib import Path + +BASE = Path('/Users/guchen/.openclaw/workspace/org/cases/arxiv_digest') +OUT_DIR = BASE / 'output' +STATE_DIR = BASE / 'state' +OUT_DIR.mkdir(parents=True, exist_ok=True) +STATE_DIR.mkdir(parents=True, exist_ok=True) + +CATS = ['cs.AI', 'cs.LG', 'cs.CL', 'cs.CV', 'cs.RO', 'stat.ML'] +MAX_RESULTS = 120 +HOT_KEYWORDS = ['agent', 'reasoning', 'multimodal', 'alignment', 'rl', 'diffusion', 'transformer', 'benchmark'] + + +def fetch(url, timeout=20): + req = urllib.request.Request(url, headers={'User-Agent': 'Val-ArXiv-Digest/1.0'}) + with urllib.request.urlopen(req, timeout=timeout) as r: + return r.read().decode('utf-8', errors='ignore') + + +def query_arxiv(): + q = ' OR '.join([f'cat:{c}' for c in CATS]) + params = { + 'search_query': q, + 'start': 0, + 'max_results': MAX_RESULTS, + 'sortBy': 'submittedDate', + 'sortOrder': 'descending', + } + url = 'http://export.arxiv.org/api/query?' + urllib.parse.urlencode(params) + xml = fetch(url) + ns = {'a': 'http://www.w3.org/2005/Atom', 'arxiv': 'http://arxiv.org/schemas/atom'} + root = ET.fromstring(xml) + papers = [] + for e in root.findall('a:entry', ns): + pid = (e.findtext('a:id', default='', namespaces=ns) or '').strip() + title = re.sub(r'\s+', ' ', (e.findtext('a:title', default='', namespaces=ns) or '').strip()) + summary = re.sub(r'\s+', ' ', (e.findtext('a:summary', default='', namespaces=ns) or '').strip()) + published = e.findtext('a:published', default='', namespaces=ns) + updated = e.findtext('a:updated', default='', namespaces=ns) + authors = [re.sub(r'\s+', ' ', (a.findtext('a:name', default='', namespaces=ns) or '').strip()) + for a in e.findall('a:author', ns)] + primary = '' + pcat = e.find('arxiv:primary_category', ns) + if pcat is not None: + primary = pcat.attrib.get('term', '') + all_cats = [c.attrib.get('term', '') for c in e.findall('a:category', ns)] + papers.append({ + 'id': pid, + 'arxiv_id': pid.split('/abs/')[-1] if '/abs/' in pid else pid, + 'title': title, + 'summary': summary, + 'published': published, + 'updated': updated, + 'authors': authors, + 'primary': primary, + 'categories': all_cats, + }) + return papers + + +def hours_since(iso): + try: + t = dt.datetime.fromisoformat(iso.replace('Z', '+00:00')) + now = dt.datetime.now(dt.timezone.utc) + return max(0.0, (now - t).total_seconds() / 3600) + except Exception: + return 999.0 + + +def hn_hits_for(paper): + # lightweight buzz proxy + q = paper['arxiv_id'] + url = 'https://hn.algolia.com/api/v1/search?' + urllib.parse.urlencode({'query': q, 'tags': 'story'}) + try: + data = json.loads(fetch(url, timeout=3)) + return int(data.get('nbHits', 0)) + except Exception: + return 0 + + +def score(p): + h = hours_since(p['published']) + recency = max(0, 72 - h) / 72 * 60 + kw = sum(1 for k in HOT_KEYWORDS if k in (p['title'] + ' ' + p['summary']).lower()) + keyword_score = min(20, kw * 4) + github_bonus = 8 if ('github.com' in p['summary'].lower() or 'code:' in p['summary'].lower()) else 0 + hn = hn_hits_for(p) + hn_score = min(12, hn * 2) + cat_bonus = 5 if p['primary'] in ['cs.AI', 'cs.LG', 'cs.CL'] else 2 + total = recency + keyword_score + github_bonus + hn_score + cat_bonus + return round(total, 2), {'recency': round(recency,2), 'keywords': keyword_score, 'github': github_bonus, 'hn': hn_score, 'cat': cat_bonus} + + +def one_liner(p): + t = p['title'] + if len(t) > 90: + t = t[:87] + '...' + return f"{t}({p['primary']})" + + +def build_digest(papers): + # limit scoring set for speed/stability + recent_pool = sorted(papers, key=lambda x: x['published'], reverse=True)[:40] + scored = [] + for p in recent_pool: + s, detail = score(p) + p2 = dict(p) + p2['hot_score'] = s + p2['score_detail'] = detail + scored.append(p2) + hot = sorted(scored, key=lambda x: x['hot_score'], reverse=True)[:5] + latest = sorted(scored, key=lambda x: x['published'], reverse=True)[:10] + return hot, latest, scored + + +def to_md(hot, latest): + today = dt.datetime.now().strftime('%Y-%m-%d') + lines = [] + lines.append(f"# ArXiv Daily Brief - {today}") + lines.append('') + lines.append('## 🔥 今日热度 Top 5(新鲜度+关键词+HN提及+代码线索)') + for i, p in enumerate(hot, 1): + lines.append(f"{i}. **{p['title']}**") + lines.append(f" - arXiv: {p['id']}") + lines.append(f" - 类别: {p['primary']} | HotScore: {p['hot_score']} | 作者: {', '.join(p['authors'][:3])}") + lines.append(f" - 速读: {one_liner(p)}") + lines.append('') + lines.append('## 🆕 最新上新 Top 10') + for i, p in enumerate(latest, 1): + lines.append(f"{i}. {p['title']} ({p['primary']}) - {p['id']}") + lines.append('') + lines.append('## Val 今日建议') + lines.append('- 先读 Top 5 里的 1-2 篇,优先看是否有可直接复用的方法/代码。') + lines.append('- 若你愿意,我下一步可对 Top 3 产出“中文三段式精读卡”(问题-方法-可落地点)。') + return '\n'.join(lines) + '\n' + + +def main(): + papers = query_arxiv() + hot, latest, scored = build_digest(papers) + md = to_md(hot, latest) + + day = dt.datetime.now().strftime('%Y-%m-%d') + out = OUT_DIR / f'{day}.md' + out.write_text(md, encoding='utf-8') + (OUT_DIR / 'latest.md').write_text(md, encoding='utf-8') + + state = { + 'updatedAt': dt.datetime.now().isoformat(), + 'date': day, + 'papersFetched': len(papers), + 'topHot': [ + {'title': p['title'], 'arxiv_id': p['arxiv_id'], 'score': p['hot_score']} for p in hot + ] + } + (STATE_DIR / 'latest_state.json').write_text(json.dumps(state, ensure_ascii=False, indent=2), encoding='utf-8') + print(str(out)) + + +if __name__ == '__main__': + main() diff --git a/org/cases/arxiv_digest/output/2026-03-08.md b/org/cases/arxiv_digest/output/2026-03-08.md new file mode 100644 index 0000000..62bed32 --- /dev/null +++ b/org/cases/arxiv_digest/output/2026-03-08.md @@ -0,0 +1,39 @@ +# ArXiv Daily Brief - 2026-03-08 + +## 🔥 今日热度 Top 5(新鲜度+关键词+HN提及+代码线索) +1. **SurvHTE-Bench: A Benchmark for Heterogeneous Treatment Effect Estimation in Survival Analysis** + - arXiv: http://arxiv.org/abs/2603.05483v1 + - 类别: cs.LG | HotScore: 33.06 | 作者: Shahriar Noroozizadeh, Xiaobin Shen, Jeremy C. Weiss + - 速读: SurvHTE-Bench: A Benchmark for Heterogeneous Treatment Effect Estimation in Survival An...(cs.LG) +2. **Accelerating Text-to-Video Generation with Calibrated Sparse Attention** + - arXiv: http://arxiv.org/abs/2603.05503v1 + - 类别: cs.CV | HotScore: 28.17 | 作者: Shai Yehezkel, Shahar Yadin, Noam Elata + - 速读: Accelerating Text-to-Video Generation with Calibrated Sparse Attention(cs.CV) +3. **Observing and Controlling Features in Vision-Language-Action Models** + - arXiv: http://arxiv.org/abs/2603.05487v1 + - 类别: cs.RO | HotScore: 28.08 | 作者: Hugo Buurmeijer, Carmen Amo Alonso, Aiden Swann + - 速读: Observing and Controlling Features in Vision-Language-Action Models(cs.RO) +4. **Towards Provably Unbiased LLM Judges via Bias-Bounded Evaluation** + - arXiv: http://arxiv.org/abs/2603.05485v1 + - 类别: cs.AI | HotScore: 27.06 | 作者: Benjamin Feuer, Lucas Rosenblatt, Oussama Elachqar + - 速读: Towards Provably Unbiased LLM Judges via Bias-Bounded Evaluation(cs.AI) +5. **An interpretable prototype parts-based neural network for medical tabular data** + - arXiv: http://arxiv.org/abs/2603.05423v1 + - 类别: cs.LG | HotScore: 26.1 | 作者: Jacek Karolczak, Jerzy Stefanowski + - 速读: An interpretable prototype parts-based neural network for medical tabular data(cs.LG) + +## 🆕 最新上新 Top 10 +1. Transformer-Based Inpainting for Real-Time 3D Streaming in Sparse Multi-Camera Setups (cs.CV) - http://arxiv.org/abs/2603.05507v1 +2. FaceCam: Portrait Video Camera Control via Scale-Aware Conditioning (cs.CV) - http://arxiv.org/abs/2603.05506v1 +3. RoboPocket: Improve Robot Policies Instantly with Your Phone (cs.RO) - http://arxiv.org/abs/2603.05504v1 +4. Accelerating Text-to-Video Generation with Calibrated Sparse Attention (cs.CV) - http://arxiv.org/abs/2603.05503v1 +5. POET-X: Memory-efficient LLM Training by Scaling Orthogonal Transformation (cs.LG) - http://arxiv.org/abs/2603.05500v1 +6. The Spike, the Sparse and the Sink: Anatomy of Massive Activations and Attention Sinks (cs.AI) - http://arxiv.org/abs/2603.05498v1 +7. Safe-SAGE: Social-Semantic Adaptive Guidance for Safe Engagement through Laplace-Modulated Poisson Safety Functions (cs.RO) - http://arxiv.org/abs/2603.05497v1 +8. Cheap Thrills: Effective Amortized Optimization Using Inexpensive Labels (cs.LG) - http://arxiv.org/abs/2603.05495v1 +9. Censored LLMs as a Natural Testbed for Secret Knowledge Elicitation (cs.LG) - http://arxiv.org/abs/2603.05494v1 +10. cuRoboV2: Dynamics-Aware Motion Generation with Depth-Fused Distance Fields for High-DoF Robots (cs.RO) - http://arxiv.org/abs/2603.05493v1 + +## Val 今日建议 +- 先读 Top 5 里的 1-2 篇,优先看是否有可直接复用的方法/代码。 +- 若你愿意,我下一步可对 Top 3 产出“中文三段式精读卡”(问题-方法-可落地点)。 diff --git a/org/cases/arxiv_digest/output/latest.md b/org/cases/arxiv_digest/output/latest.md new file mode 100644 index 0000000..62bed32 --- /dev/null +++ b/org/cases/arxiv_digest/output/latest.md @@ -0,0 +1,39 @@ +# ArXiv Daily Brief - 2026-03-08 + +## 🔥 今日热度 Top 5(新鲜度+关键词+HN提及+代码线索) +1. **SurvHTE-Bench: A Benchmark for Heterogeneous Treatment Effect Estimation in Survival Analysis** + - arXiv: http://arxiv.org/abs/2603.05483v1 + - 类别: cs.LG | HotScore: 33.06 | 作者: Shahriar Noroozizadeh, Xiaobin Shen, Jeremy C. Weiss + - 速读: SurvHTE-Bench: A Benchmark for Heterogeneous Treatment Effect Estimation in Survival An...(cs.LG) +2. **Accelerating Text-to-Video Generation with Calibrated Sparse Attention** + - arXiv: http://arxiv.org/abs/2603.05503v1 + - 类别: cs.CV | HotScore: 28.17 | 作者: Shai Yehezkel, Shahar Yadin, Noam Elata + - 速读: Accelerating Text-to-Video Generation with Calibrated Sparse Attention(cs.CV) +3. **Observing and Controlling Features in Vision-Language-Action Models** + - arXiv: http://arxiv.org/abs/2603.05487v1 + - 类别: cs.RO | HotScore: 28.08 | 作者: Hugo Buurmeijer, Carmen Amo Alonso, Aiden Swann + - 速读: Observing and Controlling Features in Vision-Language-Action Models(cs.RO) +4. **Towards Provably Unbiased LLM Judges via Bias-Bounded Evaluation** + - arXiv: http://arxiv.org/abs/2603.05485v1 + - 类别: cs.AI | HotScore: 27.06 | 作者: Benjamin Feuer, Lucas Rosenblatt, Oussama Elachqar + - 速读: Towards Provably Unbiased LLM Judges via Bias-Bounded Evaluation(cs.AI) +5. **An interpretable prototype parts-based neural network for medical tabular data** + - arXiv: http://arxiv.org/abs/2603.05423v1 + - 类别: cs.LG | HotScore: 26.1 | 作者: Jacek Karolczak, Jerzy Stefanowski + - 速读: An interpretable prototype parts-based neural network for medical tabular data(cs.LG) + +## 🆕 最新上新 Top 10 +1. Transformer-Based Inpainting for Real-Time 3D Streaming in Sparse Multi-Camera Setups (cs.CV) - http://arxiv.org/abs/2603.05507v1 +2. FaceCam: Portrait Video Camera Control via Scale-Aware Conditioning (cs.CV) - http://arxiv.org/abs/2603.05506v1 +3. RoboPocket: Improve Robot Policies Instantly with Your Phone (cs.RO) - http://arxiv.org/abs/2603.05504v1 +4. Accelerating Text-to-Video Generation with Calibrated Sparse Attention (cs.CV) - http://arxiv.org/abs/2603.05503v1 +5. POET-X: Memory-efficient LLM Training by Scaling Orthogonal Transformation (cs.LG) - http://arxiv.org/abs/2603.05500v1 +6. The Spike, the Sparse and the Sink: Anatomy of Massive Activations and Attention Sinks (cs.AI) - http://arxiv.org/abs/2603.05498v1 +7. Safe-SAGE: Social-Semantic Adaptive Guidance for Safe Engagement through Laplace-Modulated Poisson Safety Functions (cs.RO) - http://arxiv.org/abs/2603.05497v1 +8. Cheap Thrills: Effective Amortized Optimization Using Inexpensive Labels (cs.LG) - http://arxiv.org/abs/2603.05495v1 +9. Censored LLMs as a Natural Testbed for Secret Knowledge Elicitation (cs.LG) - http://arxiv.org/abs/2603.05494v1 +10. cuRoboV2: Dynamics-Aware Motion Generation with Depth-Fused Distance Fields for High-DoF Robots (cs.RO) - http://arxiv.org/abs/2603.05493v1 + +## Val 今日建议 +- 先读 Top 5 里的 1-2 篇,优先看是否有可直接复用的方法/代码。 +- 若你愿意,我下一步可对 Top 3 产出“中文三段式精读卡”(问题-方法-可落地点)。 diff --git a/org/cases/arxiv_digest/state/latest_state.json b/org/cases/arxiv_digest/state/latest_state.json new file mode 100644 index 0000000..8e47ff3 --- /dev/null +++ b/org/cases/arxiv_digest/state/latest_state.json @@ -0,0 +1,32 @@ +{ + "updatedAt": "2026-03-08T14:48:22.617040", + "date": "2026-03-08", + "papersFetched": 120, + "topHot": [ + { + "title": "SurvHTE-Bench: A Benchmark for Heterogeneous Treatment Effect Estimation in Survival Analysis", + "arxiv_id": "2603.05483v1", + "score": 33.06 + }, + { + "title": "Accelerating Text-to-Video Generation with Calibrated Sparse Attention", + "arxiv_id": "2603.05503v1", + "score": 28.17 + }, + { + "title": "Observing and Controlling Features in Vision-Language-Action Models", + "arxiv_id": "2603.05487v1", + "score": 28.08 + }, + { + "title": "Towards Provably Unbiased LLM Judges via Bias-Bounded Evaluation", + "arxiv_id": "2603.05485v1", + "score": 27.06 + }, + { + "title": "An interpretable prototype parts-based neural network for medical tabular data", + "arxiv_id": "2603.05423v1", + "score": 26.1 + } + ] +} \ No newline at end of file