Skip to content

Match visual page discovery by page_nums across shared boundaries - #484

Merged
EricNGOntos merged 3 commits into
mainfrom
feat/wuchengke/visual-page-num-match
Oct 29, 2026
Merged

EricNGOntos merged 3 commits into
mainfrom
feat/wuchengke/visual-page-num-match

Conversation

@EricNGOntos

Copy link
Copy Markdown
Contributor

Summary

  • Decouple visual page discovery from single document_page_embeddings.chunk_id ownership: join by page_num ∈ chunk.page_nums so shared boundary pages (section end + next section start) light both neighbors.
  • Prefer start-page owners when rebinding the residual chunk_id column during publication.
  • Clean progressive scope enrichment leftovers (StagedEnrichment removal / related publication wiring) and add local-dev debug helpers.

Test plan

  • make check
  • apps/api/tests/contract/test_scope_enrichment_publish_contract.py boundary visual M0/coarse assertions
  • Live TAOCP Appendix B section_targets returns pages [638..643] including opening page 638; Appendix A neighbor also keeps 638
  • CI green on PR
  • Smoke classic/hybrid retrieval after merge

Made with Cursor

EricNGOntos and others added 3 commits October 29, 2026 10:27
- Removed unused `StagedEnrichment` class and related functionality to streamline the enrichment process.
- Updated tests to reflect changes in scope handling and ensure accurate task enqueuing.
- Adjusted publication logic to enhance the efficiency of namespace generation and document scope content replacement.
- Improved documentation for clarity on the progressive ingestion state and job creation processes.
- Updated test cases to reflect changes in chunk content and metadata for better accuracy in visual page discovery.
- Improved SQL queries for visual discovery to utilize materialized views, optimizing performance and clarity.
- Adjusted logic for handling page numbers and chunk ownership to ensure correct retrieval across sections.
- Enhanced assertions in tests to validate the expected behavior of visual discovery with boundary pages.
Remove an unused test import and type the vector_repair stage update so lint and typecheck stay green.

Co-authored-by: Cursor <[email protected]>
@EricNGOntos
EricNGOntos merged commit d1d72ff into main Oct 29, 2026
6 checks passed
@EricNGOntos
EricNGOntos deleted the feat/wuchengke/visual-page-num-match branch October 29, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant