Repository navigation
fix(rag): index MinerU reference lists and skip page furniture - #2223
Merged
pancacake merged 1 commit intoOct 31, 2026
Merged
Conversation
build_pdf_documents() ignored MinerU list_items, so bibliography entries on type=list / sub_type=ref_text blocks never reached the chunker. Page-number, header, and footer blocks were indexed instead. Fixes HKUDS#2222
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
MinerU reference lists are
content_listblocks withtype: list,sub_type: ref_text, and the citations inlist_items. PDF indexing only readtext,content,table_body, and captions, so those entries never reached the chunker. Page-number, header, and footer blocks were indexed and could become standalone numeric chunks.build_pdf_documents()now includeslist_itemsand skips those page-furniture blocks. A page whose blocks are only furniture no longer falls back to the PDF text layer, so the printed page number is not indexed after the block is dropped. Margin notes and page footnotes are still indexed. Pages with real blocks and no extracted text still use native page text.Related Issues
Module(s) Affected
servicestestsChecklist
dev(notmain— see the base-branch selector above).pre-commit run --all-filesand fixed any issues.Additional Notes
This change was AI-assisted and was reviewed and tested.
python -m pytest tests/services/rag/test_source_pages.py tests/services/rag/test_mastery_source_pages.py— 92 passed, 1 skipped.Pre-commit passed on the changed files. A full-tree
pre-commit run --all-filesstill reports existing mypy errors indeeptutor/learning/scheduler.pyanddeeptutor/services/search/providers/youcom.py, which this change does not touch.