bug(pipelines): shortcode stripping deletes text between a {{< >}} shortcode and the next {{% %}}
Los mantenedores suelen responder en 3 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 70/100
Línea de trabajo
El error está en HUGO_SHORTCODE_RE en docs-agent-mcp/pipelines/utils/canonical_rag_ingest.py, usado por _strip_hugo_artifacts(). Ejecuta el fragmento de reproducción del issue: debería imprimir 'A keep this B' en lugar de 'A B'. Está terminado cuando la alternativa de shortcode {{< deja de coincidir con texto hasta un %}} posterior, y una prueba cubre el texto entre un shortcode de corchete angular y uno de porcentaje.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 49
- Forks
- 122
- Merge medio
- 10 h 54 min
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de kubeflow/docs-agent
-
bug(mcp): release-date version rerank matches 1.1 against 1.10, v2.1.1 and 11.1Posiblemente ocupada @Aryan-Pardeshi la tomó hace 19 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
kubeflow/docs-agent#279 ·
Los mantenedores suelen responder en 3 días
-
bug(mcp): Milvus search failures escape the tool boundaryPosiblemente ocupada @sanjayy0612 la tomó hace 62 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
kubeflow/docs-agent#251 ·
Los mantenedores suelen responder en 3 días
-
bug(frontend): the chat widget calls two functions that no longer existPosiblemente ocupada @Neilblaze la tomó hace 67 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
kubeflow/docs-agent#247 ·
Los mantenedores suelen responder en 3 días
-
fix: update API server paths in README to point to legacy directoryPosiblemente ocupada @pratik-naik003 la tomó hace 101 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
kubeflow/docs-agent#225 · 1 reacción ·
Los mantenedores suelen responder en 3 días
-
Issues pipeline chunk_size (1500) exceeds the TEI embedding limit (1000) — tail of long chunks is unsearchablePosiblemente ocupada @Sharkyii la tomó hace 134 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
kubeflow/docs-agent#216 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
Todos los issues de kubeflow/docs-agent
Issues similares
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
splunk/security_content#4418 ·
Los mantenedores suelen responder en 1 día
-
[Bug / Enhancement]: Improve teleop_robot CLI with configurable timeout, robust input validation, and clean ROS shutdownPosiblemente ocupada @muskan-creates352 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Imbad0202/academic-research-skills#1093 ·
Los mantenedores suelen responder en 1 día
-
Input: placeholder drawn in the text colour when the empty Input is focused but not yet editedAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pierreaubert/gpui-toolkit#114 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Lightricks/LTX-2#336 · 1 comentario ·