Slim search index by deduplicating tf/drun mirror entries #7934
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 179 lines diff across 2 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.311
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #7934"
general
weight: 0.35
windsonsea
Material indexes the same pages three times: once under the canonical path and again under the tf/ and drun/ symlink mirrors (9,450 zh and 9,481 en entries). The search worker rebuilds the lunr index from all of them on every session start, making the 35.8 MB index the dominant memory and transfer cost.
Add scripts/ci/slim_search_index.py, a post-build step that drops a tf/drun entry only when a main-path entry with the exact same title and text exists. This preserves the ~270 genuinely unique entries under tf/ and drun/ (intro/, quickstart/, install/, *-rn/ are real directories) and landing pages like tf/index.md whose stripped path collides with a main path but whose content differs.
Only the generated search/search_index.json files are rewritten -- no source Markdown, navigation config, HTML page or sitemap changes. Search results for mirrored URLs now resolve to the canonical path.
Results: zh 22,723 -> 13,273 docs, 35.8 -> 21.1 MB (-41%); en 21,685 -> 12,204 docs, 18.6 -> 10.6 MB (-43%); corpus text -43%. Index parse heap measured with Node: zh 25.8 -> 4.0 MB.
Wired into Makefile build and build-path targets so all CI builds (main.yml, main.path.yml, Netlify preview) process the index before the incremental upload. Verified with the real production indexes: dry-run counts, exact-twin guarantee for every dropped entry, config equality, order preservation, unique-page retention, idempotency.
Fix #7932