Skip to content

Staging - #295

Merged
suguanYang merged 15 commits into
stagingfrom
main
Aug 15, 2026
Merged

suguanYang merged 15 commits into
stagingfrom
main

Conversation

@suguanYang

Copy link
Copy Markdown
Contributor

No description provided.

EricNGOntos and others added 15 commits August 13, 2026 15:05
- Introduced `_clear_toc_anchor_state` method to reset TOC anchor-related attributes in `ProfileCoordinator`.
- Updated `PageAnatomyMap` and `AgentBlackboard` to include new fields for `skeleton_anchor`, `skeleton_nodes`, and `pending_skeleton_anchors`.
- Integrated `run_toc_anchoring` in the extraction pipeline to improve TOC processing.
- Added serialization and deserialization functions for `skeleton_anchor` and `title_node` to support new data structures.
- Refactored `extract_section_skeletons` to utilize persisted `skeleton_anchor` for section boundary resolution.
- Added `rapidocr-onnxruntime` as a dependency for OCR capabilities.
- Implemented `_run_text_scan` method in `ProfileCoordinator` to handle text extraction from PDF pages.
- Updated `PageAnatomyMap` to include `page_full_text_cache` for storing scanned text.
- Enhanced TOC anchoring logic to utilize cached page text for improved accuracy.
- Refactored various tools to leverage the new text scanning functionality, ensuring seamless integration with existing workflows.
- Removed `run_toc` and `_run_toc` methods from `ProfileCoordinator` to streamline TOC processing.
- Eliminated `page_full_text_cache` from `PageAnatomyMap` and related logic to simplify data handling.
- Updated tests to reflect changes in TOC extraction and anatomy map structure, ensuring consistency in functionality.
- Removed `min_pages` parameter from `validate_shard_plan` and related functions to simplify validation logic.
- Updated `ProfileCoordinator` to clarify comments regarding single-shard placeholder usage.
- Refactored `propose_shard_plan` and `validate_anatomy_map` to enhance clarity and maintainability.
- Adjusted tests to reflect the removal of `min_pages` and ensure consistency with updated validation logic.
- Introduced `_attach_toc_page_links` method to attach hyperlinks to TOC entries before calibration.
- Updated `run_toc_anchoring` to conditionally skip anchoring based on settings.
- Refactored `ProfileCoordinator` to ensure asset probes are executed in the correct order relative to TOC processing.
- Enhanced `collect_toc_page_links` to normalize page link destinations and improve link matching logic.
- Updated `profile_document` to include a new parameter for skipping TOC anchoring during profiling.
- Adjusted tests to validate the new TOC processing flow and ensure correct asset probing order.
- Moved import statements for `anchor_hierarchy`, `finalize_calibration_result`, `pick_primary_offset`, `calibrate_offset`, and `graft_contained_toc` to the top of the file for better readability.
- Removed redundant import statements to enhance clarity and maintainability of the `toc_anchoring.py` file.
Lazy imports in toc_anchoring broke module-level mocks; point patches at
orchestrator/service/procedure instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
Contract tests were still patching symbols on toc_anchoring that are only
imported inside functions after the circular-import refactor.

Co-authored-by: Cursor <cursoragent@cursor.com>
api and worker both use top-level `app`, so a combined pytest run can
leave stale module bindings; patch the defining function globals and run
the suites separately in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
…calibration

feat: TOC link attach, 1-based pages, and profile stage wiring
fix(ecs): preserve validated staging worker CPU
…ontrols

Add manual staging ECS availability controls
@suguanYang
suguanYang merged commit bafef80 into staging Aug 15, 2026
5 checks passed


def test_classify_toc_relationship_is_not_on_c4_module() -> None:
import app.services.page_memory.skeleton_extractor as skeleton_extractor
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.

3 participants