fix: page-memory fine-hierarchy boundary trim and null-page parent locate - #220
Merged
Merged
Conversation
This commit eliminates the page locate sub-agent and its associated tools, streamlining the hierarchy locator module. The VLM page verification process is now directly integrated into the hierarchy locator, enhancing efficiency and reducing complexity. Unused configurations and functions related to the residual agent have also been removed from the page memory configuration.
Add window-bounded locate for coarse TOC parents whose printed_page is null (compact-strict text match with visual RTL fallback), emitting parent self-only skeletons so interstitial content is not swallowed. Sort skeletons by start_page only and build the hierarchy tree from list order, so same-page siblings keep VLM/TOC reading order instead of being reordered alphabetically by section_path. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # apps/worker/app/services/page_memory/_serialization.py # packages/shared-python/shared/models/schemas/page_memory_config.py
The null-page parent locate is already implemented on this branch, so the placeholder TODO reintroduced by the merge is misleading. Also remove the duplicated page-memory serialization import left by the merge. Co-authored-by: Cursor <cursoragent@cursor.com>
Prevent next-section titles from bleeding into the current fat leaf when the VLM fails to observe the coarse end anchor. Align next-title ordering with stable reading order so same-page parent/child anchors stay correct. 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
build_next_title_by_pathwith stable reading-ordersort_skeletons(immediate next skeleton, including same-page parent → first child) instead ofsection_pathalphabetical / later-page-only lookup.parent_self_only), VLM-order skeleton sorting, and removal of the residual page-location agent.Test plan
make check(ruff + pyright)pytest apps/worker/tests/contract/test_page_memory_fine_hierarchy_contract.py(7 passed, including new tail-miss / next-title order cases)__boundary_clipout-dir vs baseline — locate/scopes identical after path-slash normalize--scope-id p14-23: fine hierarchy ends atNCC 2022; baseline’s leakedList of amendmentsis goneMade with Cursor