Skip to content

feat: doc profile coarse margins and asset probing - #225

Merged
EricNGOntos merged 7 commits into
mainfrom
feat/wuchengke/profile-asset-margins
Jul 24, 2026
Merged

feat: doc profile coarse margins and asset probing#225
EricNGOntos merged 7 commits into
mainfrom
feat/wuchengke/profile-asset-margins

Conversation

@EricNGOntos

Copy link
Copy Markdown
Contributor

Summary

  • Run text probe → coarse VLM (≤10 pages) → asset probe; VLM emits document-level header_y / footer_y content margins.
  • Filter aggregated drawing figures by min area (5000 pt²) and header/footer band (any edge outside drops the figure).
  • Speed up figure clustering with a spatial grid; also includes related page-memory asset/tagging cleanup on this branch.

Test plan

  • make check (ruff + pyright)
  • Manual coarse+asset probe on EN_Global Memory Tech.pdf and EN_Sydney Streets Code.pdf
  • CI green on this PR

Made with Cursor

EricNGOntos and others added 5 commits July 21, 2026 16:32
- Added `observed_titles` to the `serialize_page_tags` function for improved title tracking.
- Introduced `serialize_scope_skeletons` to handle scope input artifacts, facilitating Stage3 to Stage4 handoff.
- Updated `write_scope_artifacts` to conditionally write `tags` and `assets_by_page`, preventing overwrites when set to None.
- Enhanced title detection logic in `tag_vlm_titles` to escalate token budgets dynamically when JSON responses are truncated, improving robustness in title extraction.

This commit improves the handling of page memory artifacts and enhances the title detection process, ensuring better data integrity and extraction accuracy.
- Deleted `chart_asset_probe.py` and `vlm_bbox_tabula_probe.py` as they are no longer needed.
- These scripts were used for experimental purposes related to VLM-driven asset detection and table extraction, but have been superseded by more efficient implementations.

This cleanup helps streamline the codebase by removing outdated experimental files.
… related tests

- Changed `asset_extraction_enabled` to `True` in `PageMemoryConfig` to activate asset extraction functionality.
- Updated the `page_asset_extraction_enabled` function to return `True`, reflecting the new configuration.
- Modified a test to assert that asset extraction is enabled for page memory jobs.
- Added `.gitignore` entry for the `experiments` directory in the worker app to exclude local debugging scripts.

This commit enhances the asset extraction capabilities in the page memory system, ensuring that the feature is properly enabled and tested.
- Added `_ensure_asset_probe` method to `ProfileCoordinator` to ensure asset probing occurs during profile generation.
- Introduced `has_asset` and `asset_bboxes` fields in `PageFeature` for tracking asset presence and bounding boxes.
- Updated `aggregate_doc_stats` to include asset-related statistics when assets have been probed.
- Refactored `probe_page_features` to support asset probing alongside existing features.
- Modified `planner` and `tagger` logic to accommodate new asset-related data and improve document profiling accuracy.

This commit enhances the document agent's ability to extract and utilize asset information, improving overall profiling and analysis capabilities.
Co-authored-by: Cursor <cursoragent@cursor.com>
finally:
try:
doc.close()
except Exception:
EricNGOntos and others added 2 commits July 24, 2026 17:22
…apabilities

- Removed the `ProfileAgent` class to simplify the document agent architecture.
- Updated `ProfileCoordinator` methods to include a `skip_shard_plan` parameter, allowing for more flexible profiling without LLM shard decisions.
- Enhanced `PageAnatomyMap` to include `toc_hierarchies` for improved TOC handling.
- Cleaned up unused fields and methods related to asset probing and text previews, ensuring a more efficient codebase.

This commit improves the overall structure and efficiency of the document agent, facilitating better profiling and asset management.
Keep test_summary_builder.py from main (#221); it was deleted on this
branch unrelated to asset probing.

Co-authored-by: Cursor <cursoragent@cursor.com>
@EricNGOntos
EricNGOntos merged commit 5f05ce4 into main Jul 24, 2026
6 checks passed
@EricNGOntos
EricNGOntos deleted the feat/wuchengke/profile-asset-margins branch July 24, 2026 13:52
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.

2 participants