bug(pipelines): shortcode stripping deletes text between a {{< >}} shortcode and the next {{% %}}
メンテナーはふだん 3 日以内に返信
評価
調査の方向性
バグは docs-agent-mcp/pipelines/utils/canonical_rag_ingest.py の HUGO_SHORTCODE_RE にあり、_strip_hugo_artifacts() から使われています。issue の再現スニペットを実行してください。'A B' ではなく 'A keep this B' と出力されるはずです。{{< のショートコード分岐が、後に出現する %}} までのテキストにマッチしなくなり、山括弧のショートコードとパーセントのショートコードの間のテキストをテストがカバーすれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Area
pipelines
What happened
HUGO_SHORTCODE_RE in docs-agent-mcp/pipelines/utils/canonical_rag_ingest.py is
re.compile(r"\{\{.*?%\}\}|\{\{.*?\}\}", re.DOTALL)
The first alternative can start at any {{, not only at {{%. When the parser reaches an angle-bracket shortcode such as {{< figure ... >}}, that alternative matches lazily forward to the next %}} anywhere later in the page, and _strip_hugo_artifacts() deletes everything in between, before the document is split into sections and chunks.
On the current kubeflow/website content (commit a7b22c9), running every page through parse_canonical_document() with the current regex and with a fixed one shows text lost on 5 pages (970 characters in total). The largest case is content/en/docs/started/installing-kubeflow/index.md, which loses the rows for five packaged distributions (prokube.ai, Microsoft Azure, Nutanix, QBO and Red Hat). Those vendors never reach the index, so the assistant cannot answer "is there a Kubeflow distribution for Azure / Red Hat / Nutanix?" from the docs. The other four pages are API reference pages that lose their spec link text.
Expected behavior
Only the shortcodes themselves are removed. Text between two shortcodes is kept.
Reproduction
From the repo root:
import sys
sys.path.insert(0, "docs-agent-mcp/pipelines/utils")
from canonical_rag_ingest import _strip_hugo_artifacts
print(repr(_strip_hugo_artifacts(
'A {{< figure src="/a.png" >}} keep this {{% kf-latest-version %}} B'
)))
Output on main (145409a): 'A B'
Expected: 'A keep this B'
Environment: local, Python 3.12, no cluster needed.
Suspected files
docs-agent-mcp/pipelines/utils/canonical_rag_ingest.py (HUGO_SHORTCODE_RE, _strip_hugo_artifacts)
I have a fix with tests ready and will open a PR.
- 主要言語
- Python
- スター
- 49
- フォーク
- 122
- 平均マージ
- 10時間 54分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
kubeflow/docs-agent のほかの issue
-
bug(mcp): release-date version rerank matches 1.1 against 1.10, v2.1.1 and 11.1対応中かも @Aryan-Pardeshi が 19 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
kubeflow/docs-agent#279 ·
メンテナーはふだん 3 日以内に返信
-
bug(mcp): Milvus search failures escape the tool boundary対応中かも @sanjayy0612 が 62 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
kubeflow/docs-agent#251 ·
メンテナーはふだん 3 日以内に返信
-
bug(frontend): the chat widget calls two functions that no longer exist対応中かも @Neilblaze が 67 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
kubeflow/docs-agent#247 ·
メンテナーはふだん 3 日以内に返信
-
fix: update API server paths in README to point to legacy directory対応中かも @pratik-naik003 が 101 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
kubeflow/docs-agent#225 · リアクション 1 件 ·
メンテナーはふだん 3 日以内に返信
-
Issues pipeline chunk_size (1500) exceeds the TEI embedding limit (1000) — tail of long chunks is unsearchable対応中かも @Sharkyii が 134 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
kubeflow/docs-agent#216 · コメント 2 件 ·
メンテナーはふだん 3 日以内に返信
kubeflow/docs-agent の issue をすべて見る
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
splunk/security_content#4418 ·
メンテナーはふだん 1 日以内に返信
-
[Bug / Enhancement]: Improve teleop_robot CLI with configurable timeout, robust input validation, and clean ROS shutdown対応中かも @muskan-creates352 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Imbad0202/academic-research-skills#1093 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pierreaubert/gpui-toolkit#114 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Lightricks/LTX-2#336 · コメント 1 件 ·