argo-search 2.10.1 → 2.11.2

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 (89) hide show
  1. package/README.en.md +48 -11
  2. package/README.es.md +48 -11
  3. package/README.ja.md +48 -11
  4. package/README.ko.md +47 -10
  5. package/README.md +48 -31
  6. package/SKILL.md +16 -15
  7. package/backends/concept_vectors.bin +0 -0
  8. package/backends/domain_profiles.json +18 -6
  9. package/backends/engine_concept_vectors.json +3104 -0
  10. package/backends/engine_registry.yaml +38 -13
  11. package/backends/quota_profiles.json +30 -10
  12. package/bin/argo +6 -0
  13. package/config.yaml +98 -31
  14. package/docs/ENGINE_CATALOG.md +11 -8
  15. package/docs/RELEASE_NOTES_v2.10.2.md +48 -0
  16. package/docs/RELEASE_NOTES_v2.11.2.md +50 -0
  17. package/engines/specs/animetrace.yaml +35 -0
  18. package/engines/specs/google_lens.yaml +50 -0
  19. package/engines/specs/saucenao.yaml +45 -0
  20. package/package.json +4 -2
  21. package/packages/dsh-plugin/dsh/diagnostics.js +8 -3
  22. package/packages/dsh-plugin/dsh/index.js +12 -7
  23. package/packages/dsh-plugin/dsh/runner.js +79 -47
  24. package/packages/dsh-plugin/package.json +1 -1
  25. package/packages/dsh-plugin/test/index.test.js +64 -0
  26. package/scripts/argo_engine_registry.py +30 -4
  27. package/scripts/argo_paths.py +7 -1
  28. package/scripts/budget.py +13 -3
  29. package/scripts/build_concept_table.py +612 -0
  30. package/scripts/build_route_labels.py +285 -0
  31. package/scripts/caliber_dedupe.py +66 -0
  32. package/scripts/caliber_isolation.py +4 -2
  33. package/scripts/circuit_breaker.py +25 -3
  34. package/scripts/concept_lookup.py +212 -0
  35. package/scripts/engine_dispatch.py +2 -1
  36. package/scripts/engine_families.py +7 -3
  37. package/scripts/engines.py +34 -9
  38. package/scripts/engines_base.py +17 -2
  39. package/scripts/engines_builders.py +0 -1
  40. package/scripts/engines_builders_intl.py +4 -4
  41. package/scripts/engines_builders_reverse_image.py +783 -0
  42. package/scripts/engines_builders_skill.py +87 -10
  43. package/scripts/engines_builders_tech.py +0 -78
  44. package/scripts/extend_route_labels.py +239 -0
  45. package/scripts/extend_route_labels_by_capability.py +344 -0
  46. package/scripts/extend_route_labels_by_language.py +306 -0
  47. package/scripts/gen_routing_snapshot.py +22 -3
  48. package/scripts/job.py +2 -1
  49. package/scripts/lang_detect.py +12 -3
  50. package/scripts/lint_spec_contracts.py +110 -0
  51. package/scripts/lint_stub_targets.py +130 -0
  52. package/scripts/local_image.py +3 -3
  53. package/scripts/local_seek.py +13 -3
  54. package/scripts/mcp_compact.py +5 -0
  55. package/scripts/mcp_transport.py +1 -1
  56. package/scripts/net_proxy.py +47 -0
  57. package/scripts/numeric_verify.py +330 -0
  58. package/scripts/plan.py +36 -4
  59. package/scripts/pre-commit +21 -13
  60. package/scripts/quota.py +109 -10
  61. package/scripts/rank_signals.py +48 -4
  62. package/scripts/ranking_eval.py +23 -1
  63. package/scripts/regression_p0p1.py +7 -2
  64. package/scripts/route.py +24 -3
  65. package/scripts/route_accuracy_eval.py +191 -0
  66. package/scripts/route_combo.py +32 -1
  67. package/scripts/route_domains.py +242 -5
  68. package/scripts/route_primary.py +101 -0
  69. package/scripts/search.py +14 -12
  70. package/scripts/search_cli.py +89 -7
  71. package/scripts/search_output.py +59 -1
  72. package/scripts/search_pipeline.py +20 -15
  73. package/scripts/snippet_clean.py +60 -0
  74. package/scripts/social_engines/twitter_engine.py +159 -42
  75. package/scripts/social_engines/xiaohongshu_engine.py +36 -1
  76. package/scripts/tfidf_router.py +52 -2
  77. package/scripts/train.py +15 -0
  78. package/scripts/verify_with.py +124 -0
  79. package/sub-skills/local-search/SKILL.md +3 -2
  80. package/sub-skills/local-search/bm25.py +89 -8
  81. package/sub-skills/local-search/config.yaml +12 -0
  82. package/sub-skills/local-search/parse_maps.yaml +8 -0
  83. package/sub-skills/local-search/parsers.py +5 -2
  84. package/sub-skills/local-search/search_v3.py +87 -1
  85. package/sub-skills/local-search/smart_router.py +1 -1
  86. package/sub-skills/local-seek/SKILL.md +6 -5
  87. package/sub-skills/local-seek/scripts/eval_rank.py +1 -1
  88. package/sub-skills/local-seek/scripts/seek.py +152 -36
  89. package/sub-skills/local-seek/scripts/seek_rank.py +191 -11
@@ -103,7 +103,6 @@ from engines_builders import (
103
103
  _build_stackoverflow_engine,
104
104
  _build_google_scholar_engine,
105
105
  _build_v2ex_engine,
106
- _build_tineye_engine,
107
106
  _build_bing_rss_engine,
108
107
  _build_ths_hot_engine,
109
108
  _build_cls_telegraph_engine,
@@ -226,6 +225,13 @@ from engines_builders_batch10 import ( # noqa: F401
226
225
  from engines_builders_batch11 import ( # noqa: F401
227
226
  _build_wikimedia_commons_engine,
228
227
  )
228
+ # 反搜图(engines_builders_reverse_image):query 是公网图片 URL 而非关键词,
229
+ # 取数与解析都与关键词引擎不同,独立成模块。
230
+ from engines_builders_reverse_image import ( # noqa: F401
231
+ _build_animetrace_engine,
232
+ _build_google_lens_engine,
233
+ _build_saucenao_engine,
234
+ )
229
235
 
230
236
 
231
237
 
@@ -438,7 +444,9 @@ _BUILDERS = {
438
444
  "clawhub": _build_clawhub_engine,
439
445
  "google_scholar": _build_google_scholar_engine,
440
446
  "v2ex": _build_v2ex_engine,
441
- "tineye": _build_tineye_engine,
447
+ "saucenao": _build_saucenao_engine,
448
+ "animetrace": _build_animetrace_engine,
449
+ "google_lens": _build_google_lens_engine,
442
450
  "bing_rss": _build_bing_rss_engine,
443
451
  "ths_hot": _build_ths_hot_engine,
444
452
  "cls_telegraph": _build_cls_telegraph_engine,
@@ -575,9 +583,10 @@ _SEMANTIC_ENGINES = frozenset({
575
583
  # 统一剥疑问前缀与属性词,保留核心实体。只作用于实体型引擎;通用 web 引擎
576
584
  # 不动(属性词对全文检索是有用信号)。
577
585
  _ENTITY_QUERY_ENGINES = frozenset({"wikidata", "thesportsdb", "local_openstreetmap"})
586
+ _ENCYCLOPEDIA_QUERY_ENGINES = frozenset({"wikipedia", "zh_wikipedia", "baidu_baike"})
578
587
  _ENTITY_Q_PREFIX_RE = re.compile(
579
588
  r"(?i)^\s*(where\s+(is|are|was|were)|where'?s|who\s+(is|are|was)|who'?s"
580
- r"|what\s+(is|are)|when\s+(was|is|did)|which\s+\w+\s+(is|was)"
589
+ r"|what\s+(is|are)|when\s+(was|is|did)|which\s+\w+\s+(is|was)|how\s+much\s+(is|are)"
581
590
  r"|哪里|在哪[里儿]?|是谁?|是什么|什么时候|哪一[个国年])\s*",
582
591
  )
583
592
  # 英文属性词带 \b(空格分词下词边界天然成立);中文属性词不进此表——
@@ -586,16 +595,27 @@ _ENTITY_Q_PREFIX_RE = re.compile(
586
595
  _ENTITY_ATTR_RE = re.compile(
587
596
  r"(?i)\b(founding year|founded|established|headquarters?|located( in)?"
588
597
  r"|population|capital|address|club|team|stadium|league|album|discography"
589
- r"|song|movie|film|director|cast)\b",
598
+ r"|song|movie|film|director|cast|price|pricing|cost|reviews?|tutorial"
599
+ r"|guide|download|official|comparison|salary|hiring"
600
+ r"|revenue|earnings|market cap|market value|net profit|lifespan"
601
+ r"|feeding|breeding|ingredients|efficacy|dosage|side effects)\b",
590
602
  )
591
603
  # 中文属性词(含繁体):只在查询尾部剥离——中文自然语序是实体名在前、
592
604
  # 属性词在后;不碰串中,「电影频道」「歌曲排行榜」这类实体名内含属性词,
593
605
  # 串中剥离会误伤。长词优先,避免「成立年份」被「成立」截断残留「年份」。
594
606
  _ENTITY_ATTR_TAILS = (
595
- "成立年份", "成立", "创立", "創立", "总部", "總部", "位置", "球队", "球隊",
596
- "俱乐部", "俱樂部", "职能", "職能", "职责", "職責", "专辑", "專輯",
597
- "歌曲", "电影", "電影", "导演", "導演", "主演",
607
+ "成立年份", "官方价格", "市场规模", "成立", "创立", "創立", "总部", "總部",
608
+ "位置", "球队", "球隊", "俱乐部", "俱樂部", "职能", "職能", "职责", "職責",
609
+ "专辑", "專輯", "歌曲", "电影", "電影", "导演", "導演", "主演",
610
+ "多少钱", "多少字", "怎么选", "怎么样", "价格", "價格", "全书", "字数",
611
+ "万字", "评测", "对比", "推荐", "官网", "官方", "下载", "教程", "指南",
612
+ "简介", "招聘", "岗位",
613
+ # 2026-11-02 补:财报/生物/医药类属性后缀(原表缺失致「贵州茅台 2025年报
614
+ # 营收」「大熊猫 寿命 怎么养」等查询剥离前后一字不差,实体源仍 0 命中)
615
+ "净利润", "营收", "市值", "年报", "季报", "财报", "寿命",
616
+ "怎么养", "饲养", "繁殖", "成分", "功效", "用法", "用量", "副作用",
598
617
  )
618
+ _TRAILING_YEAR_RE = re.compile(r"\s+(?:19\d\d|20[0-3]\d)\s*$")
599
619
 
600
620
 
601
621
  def _entity_core_query(query: str) -> str:
@@ -622,6 +642,11 @@ def _entity_core_query(query: str) -> str:
622
642
  if not changed and q.endswith("的") and len(q) > 3:
623
643
  q = q[:-1].strip()
624
644
  changed = True
645
+ if not changed:
646
+ ym = _TRAILING_YEAR_RE.search(q)
647
+ if ym and ym.start() >= 2 and not q[:ym.start()].strip().isdigit():
648
+ q = q[:ym.start()].strip()
649
+ changed = True
625
650
  q = re.sub(r"[??::,,]+", " ", q)
626
651
  q = re.sub(r"\s+", " ", q).strip()
627
652
  return q or raw
@@ -809,8 +834,8 @@ def search(query: str, engine: str, n: int = 5, timeout: float = 8, depth: str =
809
834
  # 语义型引擎不识别平台结构化语法,剥掉字段只留核心词;透传型保持原 query。
810
835
  if engine in _SEMANTIC_ENGINES:
811
836
  query = strip_structured(query)
812
- elif engine in _ENTITY_QUERY_ENGINES:
813
- # 实体型引擎:自然语言句(疑问前缀/属性词)会让实体搜索接口空结果
837
+ elif engine in _ENTITY_QUERY_ENGINES or engine in _ENCYCLOPEDIA_QUERY_ENGINES:
838
+ # 实体/百科型引擎:自然语言句(疑问前缀/属性词/价格评测后缀)会让接口空结果
814
839
  query = _entity_core_query(query)
815
840
  eff_n = bucket_n(engine, n)
816
841
 
@@ -4,6 +4,7 @@
4
4
  from __future__ import annotations
5
5
 
6
6
  import functools
7
+ import html as _htmllib
7
8
  import io
8
9
  import json
9
10
  import math
@@ -775,6 +776,13 @@ def _apply_url_kind(rows: list[dict[str, Any]], spec: dict) -> list[dict[str, An
775
776
  return rows
776
777
 
777
778
 
779
+ # 摘要标签卫生(2026-10-31 评测基线 13/64 查询摘要带裸标签):MediaWiki 类
780
+ # 源的 snippet 字段原生含 <span class="searchmatch"> 等内联高亮标签,声明式
781
+ # 映射直通输出会污染下游阅读与引用。仅当串里确实出现「像标签」的片段才剥,
782
+ # 避免误伤含裸 < 的正文(如 "a < b":`<` 后非字母不匹配)。
783
+ _TAGISH_RE = re.compile(r"</?[a-zA-Z][^>]{0,160}?>")
784
+
785
+
778
786
  def _parse_http_payload(raw: str, fmt: str, eng: str, n: int,
779
787
  output_map: dict, spec: dict) -> list[dict[str, Any]]:
780
788
  """HTTP 引擎响应体解析(GET/POST 共用)。"""
@@ -833,8 +841,15 @@ def _parse_http_payload(raw: str, fmt: str, eng: str, n: int,
833
841
  r["published_at"] = _normalize_epoch(r["published_at"])
834
842
  if _lic and r.get("image_url"):
835
843
  r.setdefault("image_license", _lic)
836
- if isinstance(r.get("snippet"), str) and len(r["snippet"]) > 300:
837
- r["snippet"] = r["snippet"][:300]
844
+ sn = r.get("snippet")
845
+ if isinstance(sn, str):
846
+ if _TAGISH_RE.search(sn):
847
+ sn = _TAGISH_RE.sub("", sn)
848
+ if "&" in sn:
849
+ sn = _htmllib.unescape(sn)
850
+ if len(sn) > 300:
851
+ sn = sn[:300]
852
+ r["snippet"] = sn
838
853
  # 图片元数据收尾(尺寸转 int / 许可归一 / 商用判据)——落在这个共同
839
854
  # 出口而不是各 parser 里:图源有三条产出路径(声明式 output_map、
840
855
  # 自定义 builder、通用兜底),只覆盖一条会让契约对一半结果生效。
@@ -42,7 +42,6 @@ from engines_builders_tech import (
42
42
  _build_endoflife_engine,
43
43
  _build_v2ex_engine,
44
44
  _build_github_engine,
45
- _build_tineye_engine,
46
45
  _build_bing_rss_engine,
47
46
  )
48
47
  from engines_builders_cn import (
@@ -981,12 +981,12 @@ def _build_qq_music_engine(spec: dict[str, Any]) -> Any:
981
981
 
982
982
  # ── X/Twitter 单条推文(syndication 免登录通道)─────────────────────────────
983
983
 
984
- # 推文 URL / 裸 ID 提取。链接形态覆盖 x.com 与 twitter.com 两代域名,
985
- # 以及 /statuses/ 老路径与移动端分享链接的 query 参数形态。
984
+ # 推文 URL / 裸 ID 提取:覆盖两代域名、/statuses/ 老路径与 query 参数形态;
985
+ # URL/query 允许 1~25 位早期短 ID,裸数字仍按 10~20 位防普通数字误判。
986
986
  _TWEET_URL_RE = re.compile(
987
- r"(?:x\.com|twitter\.com)/[^/\s]+/(?:status|statuses)/(\d{10,20})", re.I)
987
+ r"(?:x\.com|twitter\.com)/[^/\s]+/(?:status|statuses)/(\d{1,25})", re.I)
988
988
  _TWEET_BARE_ID_RE = re.compile(r"^\d{10,20}$")
989
- _TWEET_QUERY_ID_RE = re.compile(r"[?&](?:tweet_id|status_id|id)=(\d{10,20})")
989
+ _TWEET_QUERY_ID_RE = re.compile(r"[?&](?:tweet_id|status_id|id)=(\d{1,25})")
990
990
 
991
991
 
992
992
  def extract_tweet_id(text: str) -> str | None: