argo-search 2.16.0 → 2.18.0

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.
Files changed (126) hide show
  1. package/AGENTS.md +4 -2
  2. package/README.es.md +15 -5
  3. package/README.ja.md +15 -5
  4. package/README.ko.md +15 -5
  5. package/README.md +16 -6
  6. package/README.zh.md +16 -6
  7. package/SKILL.md +12 -11
  8. package/assets/readme/counts.json +1 -1
  9. package/assets/readme/hero.svg +3 -3
  10. package/assets/readme/hero.template.svg +121 -0
  11. package/assets/readme/proof-routes.svg +17 -16
  12. package/backends/domain_profiles.json +121 -18
  13. package/backends/engine_registry.yaml +23 -0
  14. package/backends/env_passthrough.txt +2 -0
  15. package/backends/quota_profiles.json +20 -0
  16. package/bin/argo +78 -12
  17. package/docs/CHANGELOG.md +35 -1
  18. package/docs/COMMIT_STANDARD.md +12 -2
  19. package/docs/ENGINE_CATALOG.md +36 -33
  20. package/docs/RELEASE_NOTES_v2.17.0.md +66 -0
  21. package/docs/RELEASE_NOTES_v2.18.0.md +87 -0
  22. package/docs/RELEASING.md +2 -2
  23. package/engines/specs/crossref.yaml +2 -0
  24. package/engines/specs/hackernews.yaml +2 -0
  25. package/engines/specs/helve.yaml +49 -0
  26. package/engines/specs/hf_papers.yaml +2 -0
  27. package/engines/specs/openalex.yaml +9 -2
  28. package/engines/specs/twitter_cli.yaml +17 -0
  29. package/engines/specs/twitter_syndication.yaml +2 -3
  30. package/package.json +3 -1
  31. package/packages/dsh-plugin/README.md +5 -2
  32. package/packages/dsh-plugin/cordis.patch.yml +4 -1
  33. package/packages/dsh-plugin/dsh/client.js +57 -63
  34. package/packages/dsh-plugin/dsh/diagnostics.js +25 -4
  35. package/packages/dsh-plugin/dsh/index.js +109 -21
  36. package/packages/dsh-plugin/dsh/native-tools.mjs +10 -0
  37. package/packages/dsh-plugin/dsh/route-guard.js +95 -0
  38. package/packages/dsh-plugin/dsh/runner.js +49 -6
  39. package/packages/dsh-plugin/dsh/wide-research.js +20 -18
  40. package/packages/dsh-plugin/dsh/workbench-client.js +119 -20
  41. package/packages/dsh-plugin/dsh/workbench-io.js +182 -0
  42. package/packages/dsh-plugin/dsh/workbench-search.js +445 -0
  43. package/packages/dsh-plugin/dsh/workbench-suggestions.js +387 -75
  44. package/packages/dsh-plugin/dsh/workbench.js +277 -497
  45. package/packages/dsh-plugin/package.json +4 -3
  46. package/packages/dsh-plugin/scripts/sync-local.mjs +4 -2
  47. package/packages/dsh-plugin/scripts/sync-local.sh +4 -2
  48. package/packages/dsh-plugin/test/client.test.js +26 -0
  49. package/packages/dsh-plugin/test/diagnostics.test.js +5 -2
  50. package/packages/dsh-plugin/test/index.test.js +150 -1
  51. package/packages/dsh-plugin/test/workbench-concurrency.test.js +96 -0
  52. package/packages/dsh-plugin/test/workbench.test.js +422 -9
  53. package/scripts/adaptive.py +13 -11
  54. package/scripts/affected_tests.py +324 -0
  55. package/scripts/badcase_ledger.py +93 -2
  56. package/scripts/browser_auth.py +178 -4
  57. package/scripts/cache.py +68 -69
  58. package/scripts/check_commit_report.py +59 -9
  59. package/scripts/chrome_cdp.py +71 -0
  60. package/scripts/circuit_breaker.py +77 -12
  61. package/scripts/cli_io.py +8 -3
  62. package/scripts/config_cache.py +4 -3
  63. package/scripts/daemon.py +9 -2
  64. package/scripts/engine_add.py +45 -0
  65. package/scripts/engine_dispatch.py +27 -47
  66. package/scripts/engine_failure.py +33 -0
  67. package/scripts/engine_families.py +1 -0
  68. package/scripts/engine_fingerprint.py +114 -0
  69. package/scripts/engine_health.py +130 -0
  70. package/scripts/engine_states.py +54 -4
  71. package/scripts/engines.py +2 -0
  72. package/scripts/engines_base.py +19 -44
  73. package/scripts/engines_builders_intl.py +20 -94
  74. package/scripts/engines_builders_search.py +19 -8
  75. package/scripts/engines_builders_tech.py +16 -16
  76. package/scripts/engines_fields.py +23 -0
  77. package/scripts/engines_twitter_cli.py +182 -0
  78. package/scripts/evidence_grounding.py +182 -0
  79. package/scripts/fetch_browser.py +25 -10
  80. package/scripts/fetch_cli_output.py +75 -0
  81. package/scripts/fetch_dispatch.py +248 -0
  82. package/scripts/fetch_quality.py +11 -0
  83. package/scripts/fetch_v3.py +48 -114
  84. package/scripts/gate_manifest_check.py +75 -0
  85. package/scripts/gen_readme_art.py +264 -0
  86. package/scripts/intent_router.py +224 -0
  87. package/scripts/mcp_compact.py +3 -0
  88. package/scripts/mcp_handlers.py +24 -4
  89. package/scripts/mcp_tools.py +2 -0
  90. package/scripts/mcp_transport.py +24 -5
  91. package/scripts/mcp_warm.py +15 -11
  92. package/scripts/numeric_verify.py +9 -0
  93. package/scripts/output_transparency.py +10 -0
  94. package/scripts/pre-commit +65 -8
  95. package/scripts/query_operators.py +229 -1
  96. package/scripts/quota.py +19 -37
  97. package/scripts/release.py +16 -1
  98. package/scripts/release_check.py +1 -2
  99. package/scripts/research_gates.py +85 -1
  100. package/scripts/research_notes.py +52 -5
  101. package/scripts/retry_policy.py +17 -3
  102. package/scripts/route_combo.py +21 -4
  103. package/scripts/search.py +29 -29
  104. package/scripts/search_cli.py +104 -8
  105. package/scripts/search_output.py +4 -1
  106. package/scripts/social_research.py +8 -6
  107. package/scripts/source_discovery.py +611 -0
  108. package/scripts/sync_backends.py +45 -0
  109. package/scripts/time_utils.py +28 -0
  110. package/scripts/twitter_single_read.py +107 -0
  111. package/scripts/x_keyword_route.py +138 -0
  112. package/scripts/x_search.py +24 -33
  113. package/scripts/zhihu_answer_body.py +96 -0
  114. package/scripts/zhihu_answer_fetch.py +66 -0
  115. package/scripts/zhihu_answer_lookup.py +138 -0
  116. package/sub-skills/ego-search/README.md +9 -0
  117. package/sub-skills/ego-search/scripts/ego_search.py +182 -15
  118. package/sub-skills/ego-search/scripts/pacing.py +291 -0
  119. package/sub-skills/ego-search/scripts/quality.py +262 -6
  120. package/sub-skills/ego-search/scripts/runtime.py +7 -1
  121. package/sub-skills/ego-search/scripts/site_profiles.py +157 -0
  122. package/sub-skills/ego-search/scripts/webbridge_adapter.py +7 -1
  123. package/sub-skills/local-seek/SKILL.md +3 -1
  124. package/sub-skills/local-seek/scripts/seek.py +80 -109
  125. package/sub-skills/local-seek/scripts/seek_git.py +65 -0
  126. package/sub-skills/local-seek/scripts/seek_inspect.py +242 -0
@@ -98,7 +98,8 @@ def _breaker_blocked(engine_id: str) -> bool:
98
98
  """
99
99
  try:
100
100
  from circuit_breaker import get_breaker
101
- st = get_breaker().status(engine_id)
101
+ breaker = get_breaker()
102
+ st = breaker.status(engine_id)
102
103
  except Exception as _exc:
103
104
  import logging
104
105
  logging.getLogger("unified_search").debug(
@@ -107,6 +108,17 @@ def _breaker_blocked(engine_id: str) -> bool:
107
108
  import engine_states
108
109
  state = st.get("state")
109
110
  if state == engine_states.BREAKER_DISABLED:
111
+ # 打通熔断恢复环(2026-11-20 审计:3/5 disabled 引擎 2-12 天无探测字段,
112
+ # 路由硬跳过 → allow() 永不被调用 → 超冷却探测/env_fp/key_fp 自愈全部
113
+ # 死代码化)。这里只触发 allow() 的状态翻转(disabled→half_open 或指纹
114
+ # 自愈,锁内判冷却,零网络请求),本 combo 仍按 blocked 剔除(行为不变);
115
+ # 翻转后下次 status 读到 half_open 自然放行,真实调用走 allow() 正常探测。
116
+ try:
117
+ breaker.allow(engine_id)
118
+ except Exception as _exc: # 翻转失败不阻塞路由,但留痕(防再吞成静默)
119
+ import logging
120
+ logging.getLogger("unified_search").debug(
121
+ f"breaker.allow({engine_id!r}) 探测翻转失败,按 disabled 处理: {_exc!r}")
110
122
  return True
111
123
  return int(st.get("cooldown_remain") or 0) > 0
112
124
 
@@ -586,10 +598,15 @@ def _get_engines_combo(domain: dict[str, Any], enabled: set[str], mode: str = "a
586
598
  except Exception:
587
599
  pass
588
600
 
589
- # fast/budget 模式过滤付费引擎
590
- if mode in ("fast", "budget"):
601
+ # 全模式配额/预算前置预检(2026-11-24 方案 B):
602
+ # 旧实现只在 fast/budget 模式检查 is_available,导致 auto/deep 模式下配额已耗尽
603
+ # 的源(如 bocha/octen)仍被派发并反复撞 quota_exhausted。现全模式前置跳过
604
+ # (内存查表零额外 IO);fail-open 保护:若全被排除则保留原列表交执行层报清原因。
605
+ if filtered:
591
606
  quota_mgr = get_quota_manager()
592
- filtered = [e for e in filtered if quota_mgr.is_available(e, mode=mode)]
607
+ _avail = [e for e in filtered if quota_mgr.is_available(e, mode=mode)]
608
+ if _avail or mode in ("fast", "budget"):
609
+ filtered = _avail
593
610
 
594
611
  # fast/budget 模式优先前置零成本子引擎
595
612
  if mode in ("fast", "budget"):
package/scripts/search.py CHANGED
@@ -782,38 +782,38 @@ def super_search(query: str, engine: str = "auto", n: int = 5, explain: bool = F
782
782
 
783
783
  # L1 并行化:本地搜索与主搜索并行提交(仅显式开启时在宽根下提示)。
784
784
  _local_seek_explicit = include_local is not None
785
- # 「用户没有显式关掉」= 自动路径或显式 True;显式 False 不报跳过
786
- # (用户说了不要,不必再解释)。None 是自动路径,必须算「请求过」。
787
785
  _include_local_requested = include_local is not False
788
786
  include_local = _resolve_include_local(include_local, mode, query,
789
787
  decision.get("domain"))
790
- # 自动路径被判据跳过(公域查询 + 无本地信号):这是「没跑」而非「跑了没
791
- # 命中」,必须留痕,否则与显式 --no-local 无法区分(前者是系统优化,
792
- # 后者是用户选择)。显式 False 不写——用户已经说了不要,不必再报。
793
788
  _local_seek_intent_skipped = (_include_local_requested and not include_local)
789
+ from x_keyword_route import is_x_request, search_x_keywords
790
+ x_route = not local_first and not video_only and is_x_request(engine, query, decision)
791
+ if x_route:
792
+ include_local = _local_seek_intent_skipped = False
794
793
  _local_seek_future = None
795
794
  if include_local:
796
795
  _local_seek_future = _get_local_seek_executor().submit(
797
796
  _run_local_seek, query, n, warn=_local_seek_explicit,
798
797
  echo=not quiet)
799
798
 
800
- result = execute_search(
801
- query=search_query, decision=decision, max_results=n,
802
- timeout=timeout, depth=depth, cache=cache,
803
- skip_cache=skip_cache, mode=mode, on_progress=on_progress,
804
- since=since, until=until, sort=sort, timing=timing,
805
- engine_domain=engine_domain, engine_sub_domain=engine_sub_domain,
806
- )
799
+ if x_route:
800
+ result = search_x_keywords(query, n, engine=engine, since=since, until=until, timeout=timeout)
801
+ from time_utils import sort_results_by_time
802
+ result['results'] = sort_results_by_time(result['results'], sort)
803
+ result.update(mode=mode, depth=depth)
804
+ else:
805
+ result = execute_search(
806
+ query=search_query, decision=decision, max_results=n,
807
+ timeout=timeout, depth=depth, cache=cache,
808
+ skip_cache=skip_cache, mode=mode, on_progress=on_progress,
809
+ since=since, until=until, sort=sort, timing=timing,
810
+ engine_domain=engine_domain, engine_sub_domain=engine_sub_domain,
811
+ )
807
812
 
808
- # include-local 等待预算(H1,2026-09-29):deadline 跨两个等待点共享
809
- #(此处的预等待 + 下方 shape_response 的合并等待),总预算不叠加。
810
- # 主结果命中缓存时收窄到宽限窗(_local_seek_grace_s() 调用时取值:
811
- # 模块级常量只在 import 时读 env,MCP 常驻进程里改 ARGO_LOCAL_SEEK_GRACE_S
812
- # 不生效——与 _straggler_grace()/_serial_stagger() 同一原则)。
813
+ # 两个等待点共享截止时间;主结果命中缓存时使用更短的宽限窗。
813
814
  _local_wait_cached = isinstance(result, dict) and bool(result.get("cached"))
814
815
  _local_deadline = time.monotonic() + (_local_seek_grace_s() if _local_wait_cached
815
816
  else _LOCAL_SEEK_TIMEOUT_S)
816
- # 主搜索完成后,本地搜索应已就绪;若未完成则等待剩余预算
817
817
  if _local_seek_future is not None:
818
818
  try:
819
819
  _local_seek_future.result(timeout=max(_local_deadline - time.monotonic(), 0))
@@ -958,24 +958,24 @@ def super_search(query: str, engine: str = "auto", n: int = 5, explain: bool = F
958
958
  f"{_name}: registry 查无此引擎(拼写错误,或该源未随本版发布)")
959
959
 
960
960
  # 本机检索账(耗时/命中数/跳过):口径单点在 local_seek_accounting()。
961
- # 意图跳过(公域查询)与用户显式 --no-local 都要留痕,但语义不同:
962
- # 前者是系统判据,后者是用户选择——分开标记,日志里可归因。
961
+ # 意图跳过与用户显式 --no-local 都留痕,但语义不同——响应字段里分开标记。
962
+ # 跳过条目不落日志(2026-11-24):local_seek.jsonl 实测 93.7% 是跳过项
963
+ # (1490 条中 1412 条),stats / badcase_ledger 都不读这个流,唯一效果是
964
+ # 把「这次没查」刷成与「查了没有」同形的噪声;跳过率已在响应里逐次可见。
963
965
  try:
964
- _ls_acct = ({"local_seek_skipped": True,
965
- "skip_reason": "public_domain_intent"}
966
+ _ls_acct = ({"local_seek_skipped": True, "skip_reason": "public_domain_intent"}
966
967
  if _local_seek_intent_skipped else local_seek_accounting())
967
968
  result.update(_ls_acct)
968
969
  from usage_log import emit as _emit_usage_log
969
970
  from search_attribution import is_synthetic_run as _is_syn
970
- if include_local or _local_seek_intent_skipped:
971
- if not _is_syn(result.get("engines_used")):
972
- _ls_acct.update(query=(original_query or "")[:60],
973
- elapsed_ms=result.get("elapsed_ms"),
974
- count=result.get("count"))
975
- _emit_usage_log("local_seek", _ls_acct)
971
+ if include_local and not _local_seek_intent_skipped \
972
+ and not _is_syn(result.get("engines_used")):
973
+ _ls_acct.update(query=(original_query or "")[:60],
974
+ elapsed_ms=result.get("elapsed_ms"),
975
+ count=result.get("count"))
976
+ _emit_usage_log("local_seek", _ls_acct)
976
977
  except Exception:
977
978
  pass
978
-
979
979
  return result
980
980
 
981
981
 
@@ -229,6 +229,19 @@ def build_parser() -> argparse.ArgumentParser:
229
229
  "与 null 键,每条 result 留 title/url/snippet/source/score 等;"
230
230
  "fetch_required 保留)。默认 None=自动:stdout 非 tty 时"
231
231
  "启用 agent 档(Agent 消费),否则 full",)
232
+ parser.add_argument(
233
+ "--agent", action="store_true",
234
+ help="Agent 消费单开关:等价于 --json --fields agent;与 --envelope / "
235
+ "--fields full 互斥(入口直接报错,避免静默剥离 envelope)",
236
+ )
237
+ parser.add_argument(
238
+ "--intent",
239
+ choices=("news", "academic", "social", "image-reverse", "calc"),
240
+ default=None,
241
+ help="高层意图路由(免记 explicit_only 引擎名):news=时事(有 key/预算自动用 "
242
+ "deepseek_search,否则降级)、academic=学术多源、social=社交、image-reverse=反搜图、"
243
+ "calc=精确计算(wolframalpha)",
244
+ )
232
245
  parser.add_argument(
233
246
  "--archive",
234
247
  action="store_true",
@@ -400,6 +413,24 @@ def main():
400
413
  parser = build_parser()
401
414
  args = parser.parse_args()
402
415
 
416
+ # --agent 单开关展开与契约互斥校验(Fail-Fast):
417
+ # 此前 --envelope 与 --fields agent 同给只在 stderr 告警,随后静默剥成 0 字节。
418
+ # 入口直接报错可省去整轮无效搜索与重试。
419
+ if args.agent:
420
+ if args.fields == "full":
421
+ parser.error(
422
+ "--agent 与 --fields full 互斥:--agent 等价于 --json --fields agent;"
423
+ "需要全量字段请用 --json --fields full"
424
+ )
425
+ args.json_output = True
426
+ args.fields = "agent"
427
+
428
+ if args.envelope and args.fields == "agent":
429
+ parser.error(
430
+ "--envelope 与 --agent / --fields agent 互斥(agent 档会剥离 envelope 视图);"
431
+ "要 provenance 追溯请用 --json --envelope,只要瘦身答案请用 --agent"
432
+ )
433
+
403
434
  if args.json_output:
404
435
  # issue #34 第 7 条:引擎 builder 的 logger.warning(如「OCTEN_API_KEY
405
436
  # 未设置」)经 logging 的最后兜底 handler 打到 stderr,调用方一旦
@@ -564,6 +595,9 @@ def main():
564
595
  # 同一进程、同一路径上付的那一笔,否则只是把支出提前,不是省下。
565
596
  # 回归守卫见 tests/test_plan_a_optimizations.py::TestNoUnconditionalPrewarm。
566
597
  # --academic-deep:学术多源模式,自动设置 depth=deep + domain=academic
598
+ # _user_domain 记录「用户显式传了 --domain/--sub_domain」——内部模式
599
+ # (--academic-deep / --intent)设置的 engine_domain 不需要作用域告警。
600
+ _user_domain = bool(args.domain or args.sub_domain)
567
601
  if args.academic_deep:
568
602
  depth = "deep"
569
603
  engine_domain = "academic"
@@ -571,9 +605,27 @@ def main():
571
605
  depth = args.depth
572
606
  engine_domain = args.domain or None
573
607
 
608
+ # --intent 高层意图路由(仅显式传入时懒加载,默认路径零开销)
609
+ resolved_engine = args.engine
610
+ intent_boost: list[str] | None = None
611
+ intent_res: dict[str, Any] | None = None
612
+ if args.intent:
613
+ from intent_router import resolve_intent
614
+ intent_res = resolve_intent(
615
+ args.intent,
616
+ engine=resolved_engine,
617
+ domain=engine_domain,
618
+ depth=depth,
619
+ mode=args.mode,
620
+ )
621
+ resolved_engine = intent_res["engine"]
622
+ engine_domain = intent_res["domain"]
623
+ depth = intent_res["depth"]
624
+ intent_boost = intent_res.get("engines_boost")
625
+
574
626
  results = super_search(
575
627
  query=args.query,
576
- engine=args.engine,
628
+ engine=resolved_engine,
577
629
  n=args.max_results,
578
630
  explain=args.explain,
579
631
  skip_cache=args.no_cache,
@@ -585,6 +637,7 @@ def main():
585
637
  plan_only=args.plan_only,
586
638
  force_search=args.force_search,
587
639
  envelope=use_envelope,
640
+ engines_boost=intent_boost,
588
641
  since=args.since,
589
642
  until=args.until,
590
643
  sort=args.sort,
@@ -777,6 +830,56 @@ def main():
777
830
  _vw_ms = (time.perf_counter() - _t_verifywith0) * 1000.0
778
831
  _merge_verify_timing(results["timing"], _vw_ms, stage="verify_with")
779
832
 
833
+ # 若启用了 --intent,将精简解析记录与降级告警附加到结果中
834
+ if intent_res is not None:
835
+ ir_out: dict[str, Any] = {
836
+ "intent": intent_res["intent"],
837
+ "engine": intent_res["engine"],
838
+ "domain": intent_res["domain"],
839
+ "depth": intent_res["depth"],
840
+ "degraded": intent_res["degraded"],
841
+ "reason": intent_res["reason"],
842
+ }
843
+ if intent_res.get("engines_boost"):
844
+ ir_out["engines_boost"] = intent_res["engines_boost"]
845
+ # domain 字段的作用域标注(2026-11-24):intent 会设 domain,而该字段
846
+ # 不参与选源(route_query 从不读 engine_domain),只在引擎级缓存键上生效。
847
+ # 标出来,避免调用方把 `intent_resolution.domain` 读成「结果已被限定在该域」。
848
+ if intent_res.get("domain"):
849
+ ir_out["domain_scope"] = "cache_key_only"
850
+ results["intent_resolution"] = ir_out
851
+ if intent_res.get("warnings"):
852
+ existing_w = results.setdefault("warnings", [])
853
+ for w in intent_res["warnings"]:
854
+ if w not in existing_w:
855
+ existing_w.append(w)
856
+
857
+ # --domain / --sub_domain 的作用域提示(2026-11-24)。
858
+ #
859
+ # 实测:这两个参数**不参与选源**——路由决策(route_query)从不读它们,
860
+ # 全仓也只有 anysearch 的 builder 把 `domain` 下推进上游请求体
861
+ # (engines_builders_tech._build_anysearch_engine),其余 312 个源的
862
+ # builder 签名里没有这个入参。它们真正的作用是 ① 隔离引擎级缓存键
863
+ # (search_entry)、② 给 anysearch 传垂直域。
864
+ #
865
+ # 于是 `--domain finance` 配任何非 anysearch 的自动路由都是静默无效的:
866
+ # 退出码 0、无告警、结果与不传给定位「金融域」完全相同。这与 SKILL.md
867
+ # 写的「垂直域限定」承诺不符。这里不改行为(选了什么源仍由路由决定),
868
+ # 只让「该参数本次未影响选源」可见——与 issue #34 的 warnings[] 纪律同构。
869
+ if _user_domain:
870
+ # 判据用**实际调用过**的引擎(engines_used),不是路由 combo——
871
+ # combo 尾部常挂着一串 backup,anysearch 在里面并不代表它真被调用。
872
+ _used = results.get("engines_used") or []
873
+ if "anysearch" not in _used:
874
+ _w = (
875
+ f"--domain/--sub_domain 不参与选源:本次实际调用的引擎 {_used[:3]} "
876
+ "均不消费该参数,它只隔离了引擎级缓存键;要对单引擎下推垂直域请"
877
+ "显式 --engine anysearch"
878
+ )
879
+ results.setdefault("warnings", [])
880
+ if _w not in results["warnings"]:
881
+ results["warnings"].append(_w)
882
+
780
883
  # 敏感信息自动脱敏拦截(防止真实 API Key / 通用敏感凭据在输出流泄露)
781
884
  try:
782
885
  from secret_guard import redact_data
@@ -796,13 +899,6 @@ def main():
796
899
  and not args.envelope
797
900
  )
798
901
  if args.fields == "agent" or _auto_agent:
799
- if args.envelope:
800
- print(
801
- " [warning] --envelope 与 --fields agent 同时给时 envelope 会被"
802
- "剥光(实测增量 0 字节):要 provenance 请去掉 --fields agent;"
803
- "只要瘦身就别加 --envelope。",
804
- file=sys.stderr,
805
- )
806
902
  public = _strip_for_agent(public)
807
903
  print(dumps(public))
808
904
  else:
@@ -73,7 +73,8 @@ _AGENT_RESULT_FIELDS = (
73
73
  # 中间档,借鉴 DeepSeek Search 的 summary 语义。只在确有核验证据时
74
74
  # 出现(backfill_results 回填),未核验结果不造假摘要。
75
75
  "summary",
76
- "image_url", "image_license",
76
+ "image_url", "image_url_preview", "image_license",
77
+ "author", "tags", "similarity",
77
78
  # 双通道引擎(同一引擎名背后有匿名与认证两条取数通路)标出本条实际走的
78
79
  # 通道:内容范围差异正是两条通路的区别,剥掉它就只能靠猜。
79
80
  "channel",
@@ -240,6 +241,8 @@ def _strip_for_agent(payload: dict[str, Any]) -> dict[str, Any]:
240
241
  # 数值印证与核对配对(2026-11-01):同上「花了墙钟换来的」逻辑——
241
242
  # 摘要数字与原文冲突、独立官方核对簇,都是 Agent 引用前的直接依据。
242
243
  "numverify", "numeric_reorder", "verify_with",
244
+ # 高层意图路由解析(--intent 显式传入时存在,默认路径不出现、零增量)
245
+ "intent_resolution",
243
246
  )
244
247
  out: dict[str, Any] = {k: payload[k] for k in keep_top
245
248
  if payload.get(k) is not None}
@@ -32,12 +32,13 @@ def social_sentiment_research(query: str, platforms: list[str] | None = None,
32
32
  engines_used: set[str] = set()
33
33
  t0 = time.time()
34
34
 
35
- def _one(platform: str) -> tuple[str, list[dict], set[str]]:
36
- try:
35
+ def _one(platform: str):
36
+ if platform in ("twitter", "x"):
37
+ from x_keyword_route import search_x_keywords
38
+ result = search_x_keywords(query, max_results)
39
+ else:
37
40
  result = super_search(query, engine=platform, n=max_results, mode="fast")
38
- return platform, result.get("results", []), set(result.get("engines_used", []))
39
- except Exception:
40
- return platform, [], set()
41
+ return platform, result.get("results", []), result.get("engines_used", []), result.get("errors", [])
41
42
 
42
43
  # 并行抓取各平台(串行时 3 平台 × 秒级延迟累积;并行取最慢平台耗时)。
43
44
  # 总时限 90s:到点就拿已完成部分返回,没完成的平台记空结果,不再被卡住的
@@ -50,7 +51,8 @@ def social_sentiment_research(query: str, platforms: list[str] | None = None,
50
51
  platform_results[platform] = []
51
52
  social_errors.append(f"{platform}: {type(value.exc).__name__}")
52
53
  continue
53
- _platform, results, used = value
54
+ _platform, results, used, errors = value
55
+ social_errors.extend(errors)
54
56
  platform_results[_platform] = results
55
57
  all_results.extend(results)
56
58
  engines_used.update(used)