@geoly-ai/social-hub-cli 0.3.15 → 0.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cmd-manifest.json +3 -2
- package/dist/cmd-manifest.test.js +1 -0
- package/dist/cmd-manifest.test.js.map +1 -1
- package/dist/permissions-gates-notify.d.ts.map +1 -1
- package/dist/permissions-gates-notify.js +6 -0
- package/dist/permissions-gates-notify.js.map +1 -1
- package/dist/register-notify.js +27 -0
- package/dist/register-notify.js.map +1 -1
- package/package.json +3 -3
- package/skills/README.md +1 -1
- package/skills/manifest.json +2 -2
- package/skills/reddit-matrix.lock.json +1 -1
- package/skills/reddit-voc-volume/SKILL.md +54 -10
- package/skills/reddit-voc-volume/matrix-contract.md +9 -0
- package/skills/reddit-voc-volume/references/arctic-shift.md +38 -3
- package/skills/reddit-voc-volume/references/hub-first.md +9 -5
- package/skills/reddit-voc-volume/scripts/reddit_voc_volume.py +516 -3
- package/skills/reddit-voc-volume/tests/test_archived_comments.py +189 -0
- package/skills/social-hub-notifications/SKILL.md +35 -20
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Arctic Shift 归档后端(v2.12.27
|
|
1
|
+
# Arctic Shift 归档后端(v2.12.27;v2.12.31 增加评论正文)
|
|
2
2
|
|
|
3
|
-
> **何时读本文件:** 使用 `history` 模式,或 Emergency Acquisition 落到
|
|
3
|
+
> **何时读本文件:** 使用 `history` / `comments` 模式,或 Emergency Acquisition 落到
|
|
4
4
|
> `--backend arctic-shift`(缺省)时。判断某个字段能不能用,以本文件的
|
|
5
5
|
> 「能力边界」表为准。
|
|
6
6
|
|
|
@@ -31,6 +31,7 @@ failed 403`,去掉代理直连亦为 `403 Blocked`)。Arctic Shift 不走 re
|
|
|
31
31
|
| 能力 | 可用性 | 说明 |
|
|
32
32
|
|---|---|---|
|
|
33
33
|
| 正文全文 / 长度分布 / 语料 | ✅ 全程 | baseline 卡长度维度的合法来源 |
|
|
34
|
+
| 评论正文 / 评论树 | ✅ | `/api/comments/tree|search|ids`;保留 `parent_id`,适合历史 VOC |
|
|
34
35
|
| `num_comments` | ✅ 有回填 | 可用于声量 |
|
|
35
36
|
| `upvote_ratio` | ✅ 有回填 | 可用 |
|
|
36
37
|
| 版规 `/api/subreddits/rules` | ✅ | 替代 `/about/rules.json` |
|
|
@@ -39,6 +40,28 @@ failed 403`,去掉代理直连亦为 `403 Blocked`)。Arctic Shift 不走 re
|
|
|
39
40
|
| 此刻置顶 / 当前 hot | ❌ | 归档无 live 语义,走 Hub |
|
|
40
41
|
| About 页周指标 / Installed Apps | ❌ | 渲染页专有,走 Social Hub / Firecrawl |
|
|
41
42
|
|
|
43
|
+
### 评论端点(v2.12.31)
|
|
44
|
+
|
|
45
|
+
| 端点 | 用途 | 硬上限 |
|
|
46
|
+
|---|---|---:|
|
|
47
|
+
| `/api/comments/tree?link_id=t3_<post_id>` | 读取帖子评论树;超限/宽深度折叠返回 `kind=more` | 25,000 |
|
|
48
|
+
| `/api/comments/search?link_id=<post_id>` | 按 `body`、`author`、`after/before`、`parent_id` 筛选 | 100 |
|
|
49
|
+
| `/api/comments/ids?ids=...` | 按裸/t1_ 评论 ID 批查 | 500 |
|
|
50
|
+
|
|
51
|
+
Skill 入口统一为 `comments`。默认 tree;扁平 item 保留完整 `body`、原始
|
|
52
|
+
`link_id` / `parent_id`,并补 `depth` / `sibling_index` / `tree_order` /
|
|
53
|
+
`tree_path` / `child_ids`。`kind=more` 单独进入 `collapsed[]`;只要存在折叠节点,
|
|
54
|
+
`tree_complete=false`,不得声称已经拿到完整评论树。请求失败或响应不是合法
|
|
55
|
+
`data[]` 树时也必须 `ok=false`、`tree_complete=false`,不能因为 `collapsed=[]`
|
|
56
|
+
误报完整。
|
|
57
|
+
|
|
58
|
+
`parent_id` 语义按端点区分:tree 只接受裸/t1_ 评论 ID(取子树);search 的
|
|
59
|
+
`--parent-id top|root` 会显式发送空 `parent_id=` 以筛顶层评论,不能伪造成 t3_ post ID。
|
|
60
|
+
|
|
61
|
+
评论数据也受本归档约束:最新通常滞后约 2 小时,服务无 uptime 保证;评论
|
|
62
|
+
`score_status=ArchivedSnapshot` 且 `score_realtime=false`,只把正文用于历史 VOC,
|
|
63
|
+
不要把 score 当当前热度。
|
|
64
|
+
|
|
42
65
|
### `score` 为什么不可信(v2.12.28 实测修正)
|
|
43
66
|
|
|
44
67
|
**失真集中在新帖,不是旧帖。** 早期只抽老帖时看到的误差很小(归档 1 → 实时 1~6),
|
|
@@ -99,6 +122,13 @@ python3 "$VOC" history -r BuyItForLife --after 2024-01-01 --before 2024-03-31 --
|
|
|
99
122
|
# 关键词 + 跨板块历史
|
|
100
123
|
python3 "$VOC" history "noise cancelling" -r headphones -r audiophile --after 2023-01-01 --pretty
|
|
101
124
|
|
|
125
|
+
# 帖子历史评论树(默认最多 25,000)
|
|
126
|
+
python3 "$VOC" comments "https://www.reddit.com/r/example/comments/abc123/slug/" --pretty
|
|
127
|
+
|
|
128
|
+
# 评论正文筛选 / ID 批查
|
|
129
|
+
python3 "$VOC" comments abc123 --source search --body "battery life" --parent-id top --pretty
|
|
130
|
+
python3 "$VOC" comments --ids t1_def456 ghi789 --pretty
|
|
131
|
+
|
|
102
132
|
# Emergency Acquisition 显式指定后端(缺省已是 arctic-shift)
|
|
103
133
|
python3 "$VOC" keyword "PLAUD recorder" --backend arctic-shift --pretty
|
|
104
134
|
python3 "$VOC" keyword "PLAUD recorder" --backend reddit-json --pretty # 旧的 .json + curl
|
|
@@ -112,13 +142,18 @@ python3 "$VOC" keyword "PLAUD recorder" --backend reddit-json --pretty # 旧
|
|
|
112
142
|
- `score_status_counts`:三态计数
|
|
113
143
|
- `body_stats`:`with_text` / `max_chars` / `median_chars`
|
|
114
144
|
- 每条 item:`score_status`、`archived_at_post_time`、`source_fetch="arctic_shift"`
|
|
145
|
+
- `comments`:`retrieval_mode=tree|search|ids`、`tree_complete`、`collapsed[]`、
|
|
146
|
+
`body_stats`;每条评论含完整 `body`、`parent_id` 与树坐标,score 明标非实时
|
|
115
147
|
|
|
116
148
|
## 与 Hub 的关系
|
|
117
149
|
|
|
118
|
-
**不是替代,是互补。** Hub 有 live 语义和可信 score,Arctic
|
|
150
|
+
**不是替代,是互补。** Hub 有 live 语义和可信 score,Arctic 有历史深度、帖子全文和评论正文。
|
|
119
151
|
Hub-First 的四级链路不变;Arctic 只替换 L3 Emergency Acquisition 的**实现**,
|
|
120
152
|
不改变它在链路中的位置——Hub 可用时永远优先走 Hub。
|
|
121
153
|
|
|
154
|
+
`comments` 是明确的历史归档读取例外:和 `history` 一样固定直连 Arctic,不先查 Hub、
|
|
155
|
+
不派发、不接受 `--acquisition-policy`。
|
|
156
|
+
|
|
122
157
|
|
|
123
158
|
## 实时核验(v2.12.28)
|
|
124
159
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
矩阵**当下声量 / 证据类** Reddit 公开数据消费遵循四级链路:**Hub Cache → Hub Dispatch → Emergency Acquisition → Hub Write-back**。本地采集(本 skill 的 Python 工具)正式定名 **Emergency Acquisition**——它不是与 Hub 并列的默认链路,只在 Hub 失败/离线且急用时启用。
|
|
4
4
|
|
|
5
|
-
> **`history`
|
|
5
|
+
> **`history` / `comments` 模式不在本链路内。** 历史帖子与归档评论正文固定走 Arctic Shift 深度归档(权威源),**不查 Hub、不派发、不读 acquisition-policy**——Hub 只有近实时缓存、不持有深度归档。历史帖子用 `history`,帖子历史评论正文/评论树用 `comments`,不要套用下述四级链路。
|
|
6
6
|
|
|
7
7
|
前置:Social Hub CLI ≥0.2.10 已安装、`auth login`、`context use`(见 SETUP.md capability probe)。
|
|
8
8
|
|
|
9
9
|
## acquisition-policy
|
|
10
10
|
|
|
11
|
-
acquisition-policy 作用于 `keyword` / `subreddit` 以及注册了该参数的证据类模式(`stickies` / `about-page` / `page-signals` / `flair-filters`);`links` 无此参数、按 `no_hub_dispatch_path` 例外处理,而 **`history`
|
|
11
|
+
acquisition-policy 作用于 `keyword` / `subreddit` 以及注册了该参数的证据类模式(`stickies` / `about-page` / `page-signals` / `flair-filters`);`links` 无此参数、按 `no_hub_dispatch_path` 例外处理,而 **`history` / `comments` 根本不注册该参数(固定 Arctic,见上方例外框),显式传入会报错**。执行者按用户指定(缺省 `hub-first`)选择策略:
|
|
12
12
|
|
|
13
13
|
| 策略 | 行为 |
|
|
14
14
|
|---|---|
|
|
@@ -30,7 +30,7 @@ python3 scripts/reddit_voc_volume.py subreddit "packaging leak" -r foodpackaging
|
|
|
30
30
|
| 本 skill 模式 | 先执行的 Hub 查询 |
|
|
31
31
|
|---|---|
|
|
32
32
|
| search / subreddit(VOC 综合) | `social-hub intelligence voc-query --brand-keywords ... [--subreddits ...] [--need-comments] [--need-rules-evidence]`(不带 --dispatch-on-gap = 纯评估) |
|
|
33
|
-
| 评论采样 | `social-hub intelligence comments --subreddit ... [--keyword ...] [--intent ...] [--sentiment ...]` |
|
|
33
|
+
| 当下/Hub 评论采样 | `social-hub intelligence comments --subreddit ... [--keyword ...] [--intent ...] [--sentiment ...]`;帖子历史归档评论改走本 skill `comments`,不走本表链路 |
|
|
34
34
|
| about-page / page-signals / flair-filters / rules / wiki / pinned / installed-apps | `social-hub intelligence evidence-status --subreddit ...` → 有 fresh 的用 `evidence-list --subreddit ... --type ... --fresh-only` 取正文/信号 |
|
|
35
35
|
| 热帖 | `social-hub intelligence hot-posts [--subreddit ...] [--sort ...]` |
|
|
36
36
|
| links(任意 permalink 详情) | L1 查 `hot-posts`(可能未采集过而未命中);**该模式无专用 L2 派发**——未命中时允许直接 L3(fallbackReason=self_crawl_forced 不需要,记 no_hub_dispatch_path),产出必须回灌 `hot-posts-create`(帖子)/`comments-import`(评论);rules/wiki/about 类 URL 仍按证据模式走 evidence-status/evidence-fetch |
|
|
@@ -59,7 +59,7 @@ python3 scripts/reddit_voc_volume.py subreddit "packaging leak" -r foodpackaging
|
|
|
59
59
|
|
|
60
60
|
## L4:Hub Write-back(回灌)
|
|
61
61
|
|
|
62
|
-
Emergency Acquisition 的产出**必须**尝试回灌。`keyword` / `subreddit` 已自动逐帖调用 `hot-posts-create`;证据型本地 item 会调用 `evidence-import
|
|
62
|
+
Emergency Acquisition 的产出**必须**尝试回灌。`keyword` / `subreddit` 已自动逐帖调用 `hot-posts-create`;证据型本地 item 会调用 `evidence-import`。只有真实存在的评论 item 才可调用 `comments-import`,不得根据帖子 `num_comments` 伪造评论。注意:`comments` 是历史归档直读模式,不是 L3 Emergency Acquisition,当前输出明确为 `writebackStatus=not_applicable`,不会自动回灌 Hub:
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
65
|
# 帖子 → hot-posts-create(逐条)
|
|
@@ -75,7 +75,7 @@ social-hub intelligence evidence-import -j '{"subreddit":"...","evidenceType":"r
|
|
|
75
75
|
- `notVisible:true` 必须带 `visibilityEvidence`(页面明示不可见的原文片段),且不得与 content 同传。
|
|
76
76
|
- 回灌失败:输出 `writebackStatus=failed` + 保留本地产物与重试指引(端点幂等,可安全重试);成功 `done`;Hub 离线暂存 `pending`。
|
|
77
77
|
|
|
78
|
-
## 输出信封(
|
|
78
|
+
## 输出信封(Hub-First 模式,旧字段全保留)
|
|
79
79
|
|
|
80
80
|
最终 JSON 在原有结构上**新增**(不修改不删除既有字段,旧下游无需改解析器):
|
|
81
81
|
|
|
@@ -95,6 +95,10 @@ social-hub intelligence evidence-import -j '{"subreddit":"...","evidenceType":"r
|
|
|
95
95
|
}
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
+
固定归档模式使用来源专属信封:`history` / `comments` 的
|
|
99
|
+
`provenance=arctic_shift`、`runId/hubRunId=null`、`writebackStatus=not_applicable`;
|
|
100
|
+
`comments` 另带 `archive_caveats`,归档 score 不得解释为实时值。
|
|
101
|
+
|
|
98
102
|
**runId 语义(v2.12.23 起)**:`runId` 只指向产出当前 items 的 run;`hubRunId` 记录本次任务涉及的派发 run(含失败/超时的),两者不可混用。`itemsUnavailable=true` 时脚本 `ok=false`,执行者应改用 `social-hub intelligence hot-posts/comments/evidence-list` 直接读 Hub 记录,不得据此转本地采集(coverage 已满足,数据在 Hub)。
|
|
99
103
|
|
|
100
104
|
**v2.12.23 起 evidence 模式同样脚本内编排**:`stickies`(pinned)/`about-page`(about)/`flair-filters`(flair)与 subreddit 范围的 `page-signals`(page_signals)默认执行 `evidence-status → fresh 读 evidence-list --fresh-only → 缺口派 evidence-fetch --types → runs 轮询(共享退避/硬超时/定向重派一次)→ 仅 failed/timeout/unreachable 才本地`。非 subreddit 范围的 page-signals URL 与 `links` 一样走 `no_hub_dispatch_path` 例外(允许直接 L3+回灌)。
|