Skip to content

feat: add observable article link following - #35

Open
openjiuwen-sync-bot[bot] wants to merge 9 commits into
openJiuwen-ai:devfrom
openjiuwenai:sync/pr-320
Open

feat: add observable article link following#35
openjiuwen-sync-bot[bot] wants to merge 9 commits into
openJiuwen-ai:devfrom
openjiuwenai:sync/pr-320

Conversation

@openjiuwen-sync-bot

@openjiuwen-sync-bot openjiuwen-sync-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

Paired: GitHub #35GitCode !320

变更概述

为信息收集流程增加可配置的一跳文章链接跟进(article-link-follow)能力。系统能够从搜索结果或网页增强后的正文中提取文章链接,选择与当前任务相关的候选页面,并将抓取、压缩和评估通过的页面作为独立证据写回收集上下文。

功能默认关闭,不影响现有流程。

主要变更

  • 新增 info_collector_article_link_follow_enable 配置及 Server API 透传。
  • 支持从搜索结果已有正文或网页增强后的正文发现一跳链接。
  • 增加压缩前链接 sidecar,避免网页压缩导致链接丢失。
  • 支持 Markdown URL 括号和锚文本解析。
  • 增加 Wikipedia 链接去重及系统页面过滤。
  • 使用 canonical URL 进行以下去重:
    • 父页面自身链接
    • 已有搜索结果
    • 已尝试链接
    • 多父页面重复候选
    • 重定向后的重复页面
  • 对候选页面执行公网 URL 校验、重定向复检和统一抓取 deadline。
  • 支持 direct、PDF 和 Jina Reader fallback。
  • 并发抓取后集中写回,避免并发修改共享文档状态。
  • 保留完整 discovery lineage,包括父文档、父 URL、锚文本、选择原因和全部来源。
  • 增加 candidate、fetch、compression、evaluation、writeback 诊断。
  • 将下游报告诊断接入 coverage-matrix 管线:
    • report_candidate
    • report_prefilter
    • report_classification
    • report_final_reference
  • 敏感日志模式下不输出 URL、查询参数或 source ID。

开关关系

info_collector_article_link_follow_enable
info_collector_webpage_enrich_enable 相互独立:

  • 两者均关闭:跳过网页阶段。
  • 仅网页增强开启:只增强搜索结果正文。
  • 仅链接跟进开启:从搜索结果已有正文中提取链接。
  • 两者同时开启:先增强父页面,再利用压缩前 sidecar 进行链接跟进。

测试

相关测试:

277 passed, 1 warning in 51.76s
<!--  Thanks for sending a pull request!  Here are some tips for you:

1) If this is your first time, please read our contributor guidelines: https://gitcode.com/openJiuwen/community/blob/master/CONTRIBUTING.md

2) If you want to contribute your code but don't know who will review and merge, please add label `openjiuwen-assistant` to the pull request, we will find and do it as soon as possible.
-->

**What type of PR is this?**
<!-- 
选择下面一种标签替换下方 `/kind <label>`,可选标签类型有:
- /kind bug 
- /kind task
- /kind feature
- /kind refactor
- /kind clean_code
如PR描述不符合规范,修改PR描述后需要/check-pr重新检查PR规范。
-->
/kind <label>

**Self-checklist**:(**请自检,在[ ]内打上x,我们将检视你的完成情况,否则会导致pr无法合入**)

+ - [ ] **设计**:PR对应的方案是否已经经过Maintainer评审,方案检视意见是否均已答复并完成方案修改
+ - [ ] **测试**:PR中的代码是否已有UT/ST测试用例进行充分的覆盖,新增测试用例是否随本PR一并上库或已经上库
+ - [ ] **验证**:PR描述信息中是否已包含对该PR对应的Feature、Refactor、Bugfix的预期目标达成情况的详细验证结果描述
+ - [ ] **接口**:是否涉及对外接口变更,相应变更已得到接口评审组织的通过,API对应的注释信息已经刷新正确
+ - [ ] **文档**:是否涉及官网文档修改,如果涉及请及时提交资料到Doc仓

<!-- **Special notes for your reviewers**: -->
<!-- + - [ ] 是否导致无法前向兼容 -->
<!-- + - [ ] 是否涉及依赖的三方库变更 -->

<!-- bot4-pr-sync-meta
schema_version: 1
source: gitcode
gitcode_repo: openJiuwen/deepsearch
gitcode_mr: 320
github_repo: openJiuwen-ai/deepsearch
github_pr: 35
github_branch: sync/pr-320
-->

…ollow-observability

# Conflicts:
#	deepsearch/docs/feature/framework/article-link-follow.md
#	deepsearch/openjiuwen_deepsearch/algorithm/prompts/collector_article_link_follow_compress.md
#	deepsearch/openjiuwen_deepsearch/algorithm/report/article_link_follow_diagnostics.py
#	deepsearch/openjiuwen_deepsearch/algorithm/research_collector/article_link_follow.py
#	deepsearch/tests/info_collector/algorithm/test_article_link_follow.py
#	deepsearch/tests/info_collector/test_webpage_enrichment_article_link_follow.py
#	deepsearch/tests/report/test_article_link_follow_diagnostics.py
…ollow-observability

# Conflicts:
#	deepsearch/openjiuwen_deepsearch/algorithm/report/report.py
#	deepsearch/tests/utils/test_url_utils.py
@CLAassistant

CLAassistant commented Jul 30, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@openjiuwen-collaboration-bot

Copy link
Copy Markdown

head_sha: 4a299b028ace86c81999c513a5b6c89d73700fb0

任务名称 结果 日志操作
静态检查 ❌FAILED 点此跳转
防投毒检查 ✅SUCCESS 点此跳转
开源合规检查 ✅SUCCESS 点此跳转
UT测试 ✅SUCCESS 点此跳转
ST测试 N/A N/A
build 编译包 N/A N/A
ruff codecheck ✅SUCCESS N/A

@openjiuwen-collaboration-bot

Copy link
Copy Markdown

head_sha: 4a299b028ace86c81999c513a5b6c89d73700fb0

任务名称 结果 日志操作
静态检查 ✅SUCCESS 点此跳转
防投毒检查 ✅SUCCESS 点此跳转
开源合规检查 ✅SUCCESS 点此跳转
UT测试 ✅SUCCESS 点此跳转
ST测试 N/A N/A
build 编译包 N/A N/A
ruff codecheck ✅SUCCESS N/A

@openjiuwen-collaboration-bot

Copy link
Copy Markdown

head_sha: 4a299b028ace86c81999c513a5b6c89d73700fb0

任务名称 结果 日志操作
静态检查 ❌FAILED 点此跳转
防投毒检查 ✅SUCCESS 点此跳转
开源合规检查 ✅SUCCESS 点此跳转
UT测试 ✅SUCCESS 点此跳转
ST测试 N/A N/A
build 编译包 N/A N/A
ruff codecheck ✅SUCCESS N/A

@openjiuwen-collaboration-bot

Copy link
Copy Markdown

head_sha: 4a299b028ace86c81999c513a5b6c89d73700fb0

任务名称 结果 日志操作
静态检查 ✅SUCCESS 点此跳转
防投毒检查 ✅SUCCESS 点此跳转
开源合规检查 ✅SUCCESS 点此跳转
UT测试 ✅SUCCESS 点此跳转
ST测试 N/A N/A
build 编译包 N/A N/A
ruff codecheck ✅SUCCESS N/A

@openjiuwen-collaboration-bot

Copy link
Copy Markdown

head_sha: 4a299b028ace86c81999c513a5b6c89d73700fb0

任务名称 结果 日志操作
静态检查 ✅SUCCESS 点此跳转
防投毒检查 ✅SUCCESS 点此跳转
开源合规检查 ✅SUCCESS 点此跳转
UT测试 ❌FAILED 点此跳转
ST测试 N/A N/A
build 编译包 N/A N/A
ruff codecheck ✅SUCCESS N/A

@openjiuwen-collaboration-bot

Copy link
Copy Markdown

head_sha: d8d159fa78d4733655cf6706f62de38704975685

任务名称 结果 日志操作
静态检查 ✅SUCCESS 点此跳转
防投毒检查 ✅SUCCESS 点此跳转
开源合规检查 ✅SUCCESS 点此跳转
UT测试 ✅SUCCESS 点此跳转
ST测试 N/A N/A
build 编译包 N/A N/A
ruff codecheck ✅SUCCESS N/A

@@ -0,0 +1,83 @@
# 信息收集文章内链接跟进

@openjiuwen-collaboration-bot openjiuwen-collaboration-bot Bot Jul 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

head_sha: d8d159fa78d4733655cf6706f62de38704975685

增加这个工具之后的耗时情况怎么样?跑一篇默认5 章节的文章,会触发多少次这个跳转 tool?是否有限流?这个跳转是否合理?得到的结果是否有助于报告生成?这些东西都往评论贴一下

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

head_sha: d810a858c4637cba05af14110c18abc3c791378e

补充做了一次默认5章节报告的A/B验证。A组关闭article-link-follow,B组开启;两组均开启webpage enrichment,最终都生成了5个顶层章节。

1. 耗时和token开销

本次单次观测结果如下:

指标 关闭 开启
墙钟耗时 1979s 1559s
LLM调用数 274 363
total tokens 1,018,281 1,505,099
所以会导致增加一定的耗时和token消耗

2. 默认5章节会触发多少次?

本次实际执行漏斗是:
follow节点执行26轮
→ 5轮发现候选
→ 19条原始候选
→ 18条通过安全检查
→ 8条被选择并实际fetch
→ 6条fetch成功
→ 6次LLM压缩
→ 4条压缩和evaluation成功
→ 0条成功写回
因此需要区分:

  • 节点执行:26轮;
  • 真正跳转网页:8次;
  • follow专用LLM压缩:6次。
    follow并不是每章固定执行一次,而是随每个collector step执行;没有候选的轮次不会发起网页请求。

3. 是否触发限流?

本次日志中没有发现限流:

  • 没有HTTP 429;
  • 没有QPS limiter等待;
  • 没有semaphore等待记录。
    两条fetch失败也不是明确的限流问题:
  • Wiley论文的direct fetch和Jina fallback均返回403,属于目标站点访问限制;
  • GEOMAR仓储页返回empty。

4. 实际跳转是否合理?

本次实际跳转8条:

链接 结果 判断
Frontiers 2020文章自身DOI 成功处理,写回时判重 不应重复跟随
Wiley SPiCT论文DOI direct和Jina均403 目标合理,但抓取失败
LinkedIn短链 fetch成功,压缩为空 目标不透明,且parent超出时间范围
Frontiers 2022文章自身DOI 成功处理,写回时判重 不应重复跟随
同一Frontiers文章的另一/full URL 成功处理,写回时判重 URL变体重复
Creative Commons许可证页 fetch成功,压缩为空 明显不合理
Frontiers 2026文章自身DOI 成功处理,写回时判重 重复且超出任务时间范围
GEOMAR仓储页 fetch为空 可能是有效学术来源,但抓取失败

整体看,8条中只有Wiley论文和GEOMAR仓储页具有潜在新增证据价值,但两条都没有成功获取内容;其余主要是同文URL、许可证页、短链或超出时间范围的链接。
另外,19条原始候选中有11条被过滤。

5. 是否有助于报告生成?

本次没有产生实际报告贡献。
4条文档完成了fetch、压缩和evaluation,但最终都因与已有文档重复而没有写回。因此后续链路均为0:
writeback=0
report_candidate=0
report_prefilter=0
report_classification=0
report_final_reference=0
即本轮没有任何follow文档进入报告筛选或成为最终引用,也没有给报告带来article-link-follow独有的新证据。

结论

本轮5章节报告中,article-link-follow执行26轮、实际fetch 8次、增加6次专用LLM调用和68,055 tokens,但最终写回及引用均为0。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

head_sha: d810a858c4637cba05af14110c18abc3c791378e

实测下来没有实际报告贡献。不建议合入

…ollow-observability

# Conflicts:
#	deepsearch/tests/report/test_sub_report.py
@openjiuwen-collaboration-bot

Copy link
Copy Markdown

head_sha: d810a858c4637cba05af14110c18abc3c791378e

任务名称 结果 日志操作
静态检查 ✅SUCCESS 点此跳转
防投毒检查 ✅SUCCESS 点此跳转
开源合规检查 ✅SUCCESS 点此跳转
UT测试 ✅SUCCESS 点此跳转
ST测试 N/A N/A
build 编译包 N/A N/A
ruff codecheck ✅SUCCESS N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants