fix: null-page probe bounds and printed-page offset backfill - #315
Merged
Conversation
… and normalize_match_text - Updated multiple files to replace instances of normalize_heading_text with the new function normalize_heading_label for improved heading normalization. - Introduced normalize_match_text for consistent text matching, ensuring CJK-aware spacing and case-insensitivity. - Adjusted related functions and tests to reflect these changes, enhancing overall text processing accuracy.
- Replaced the read_page_texts function with read_page_text_bands to extract page content, header, and footer as structured PageTextBands. - Updated ProfileCoordinator and related services to accommodate the new text extraction method, ensuring compatibility with existing workflows. - Adjusted the blackboard state to include page_text_search_view and modified tests to validate the new structure and functionality. - Enhanced overall text processing by introducing a more granular approach to handling page content.
…functionality - Updated the null-page locating logic to differentiate between leaves and parents, improving the handling of null-page nodes. - Introduced a new function, locate_null_page_parent_overrides, to locate null-page parents using sibling windows, enhancing the accuracy of parent-child relationships. - Adjusted existing functions to accommodate the new parent locating logic, ensuring compatibility with the overall document structure. - Refined test cases to validate the new functionality and ensure robustness in null-page handling.
- Updated the strip_margin_text function to support edge-specific margin stripping for headers and footers, improving content extraction accuracy. - Introduced a new utility function, apply_null_page_locates_and_prune, to streamline null-page processing and enhance the handling of parent-child relationships in document structures. - Refactored related functions and tests to ensure compatibility with the new logic, improving overall robustness in null-page handling and text processing. - Enhanced test coverage for edge cases in margin stripping and null-page processing to validate the new functionality.
…indows - Refactored the anchor_hierarchy_from_regimes function to enhance clarity and maintainability, specifically in the handling of structural parent paths. - Introduced a new function, progressive_page_windows, to generate non-overlapping page windows for scanning, improving the efficiency of page inspections. - Updated scan_title_forward to utilize the new progressive page windows function, ensuring better management of page scanning logic. - Adjusted related tests to validate the new functionality and ensure robustness in null-page processing and page window generation.
Anchor all remaining printed nodes from nearest regime offset before null-page ReAct, and use preorder max confirmed pages for probe left bounds so nested appendices keep a usable search window. Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid PageTextBands class-identity mismatch when a prior contract fixture clears app.* modules mid-suite. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
bulk_countbefore ReAct).last_leaf_start_underhelpers and update anchoring contracts.Test plan
pytest apps/worker/tests/contract/test_structure_anchoring_contract.pymake checkMade with Cursor