fix: draw pipelines whose component names are not valid Mermaid IDs #13797
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.45) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 405 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.359
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #13797"
general
weight: 0.35
its-amann
Related Issues
Proposed Changes:
_to_mermaid_textused each component name as its Mermaid node ID. Names with a space or a parenthesis, or Mermaid keywords such asendandgraph, made mermaid.ink return 400. A component namedinputoroutputcollided with the extra networkx nodes_prepare_for_drawingadds for the pipeline's inputs and outputs and raisedKeyError, and one namedioroshared the Mermaid ID of the input/output marker, so the drawing merged them. SuperComponent names had the same problem as Mermaid class names withsuper_component_expansion=True._to_mermaid_idskeeps names that are already valid IDs (letters, digits,_, not a keyword) unchanged, so existing diagrams don't change. Every other name gets an ID with unsafe characters replaced by_plus a numeric suffix, skipping IDs already in use. The node label still shows the real name._INPUT_NODE,_OUTPUT_NODE) that can't equal a component name.How did you test it?
test/core/pipeline/test_draw.py. The three behaviour tests fail on main (KeyError: 'input'and invalid Mermaid text) and pass with the fix; the fourth covers the new helper.pytest test/core/pipeline/ test/core/super_component -m "not integration": 555 passed.hatch run fmt-checkandmypyon the changed files: clean."prompt builder",end,input,output,i,oand an expanded SuperComponent named"rag pipeline"through mermaid.ink: all failed or were wrong before, all draw correctly now.Notes for the reviewer
end,graph,flowchart,subgraph,style,linkStyle,class,classDef);End,click,default,directionrender fine.text_embedder_1. The picture is the same.This PR was developed with an AI assistant. I have reviewed the changes and run the relevant tests.
Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.