Skip to content

Staging - #339

Merged
suguanYang merged 16 commits into
stagingfrom
main
Aug 27, 2026
Merged

suguanYang merged 16 commits into
stagingfrom
main

Conversation

@suguanYang

Copy link
Copy Markdown
Contributor

No description provided.

suguanYang and others added 16 commits August 25, 2026 12:32
…og-noise

Reduce duplicate visibility watchdog log noise
* feat: enhance TOC processing and page exclusion logic

- Introduced new functions for rehoming calibrated forests and handling pending records in the TOC anchoring process.
- Updated the `compute_fat_leaf_pages` function to exclude TOC pages from the fat span test, ensuring accurate page calculations.
- Refactored various functions to utilize the new `pages_excluding_toc` utility for consistent TOC page exclusion across multiple components.
- Removed the deprecated `TocPagePolicy` class, streamlining the codebase.
- Added tests to validate the exclusion of TOC pages in fat leaf calculations.

* refactor: improve TOC rehome logic and enhance hierarchy resolution

- Updated the hierarchy locator to better handle rehome matches and leaf nodes, ensuring accurate page range resolution.
- Introduced new functions for managing rehome ranges and structural leaf identification, improving the clarity and efficiency of the code.
- Enhanced the TOC anchoring process to support global paged-leaf rehome, allowing for more robust handling of TOC structures.
- Refactored tests to validate the new rehome logic and ensure correct behavior in various scenarios.

* refactor: enhance page rendering and inspection logic

- Updated the rendering logic to support a new naming convention for PNG files, allowing for better organization based on the presence of a prefix.
- Refactored the inspection process to render pages serially before conducting concurrent inspections, improving efficiency and clarity in the workflow.
- Adjusted the handling of rendered pages in the inspection function to ensure proper coverage and error handling.
- Enhanced tests to validate the new rendering and inspection behavior, ensuring robustness in various scenarios.

* fix: pass toc_pages into outline skeleton and import extract_toc_nodes

Unblocks make check before PR sync.

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

* feat: enhance token tracking and usage reporting in document processing

- Integrated token tracking into the concurrent page inspection process, allowing for detailed tracking of token usage during parsing.
- Updated the summarization functions for DOCX and Excel formats to include usage task metadata, improving the granularity of token usage reporting.
- Refactored the debug scripts to better manage token ledger operations, including loading and recording token usage across different stages.
- Enhanced unit tests to validate the new token tracking features and ensure accurate reporting of token usage in various scenarios.

* fix: stub pending TOC calibration internals in rehome contract

Patching _calibrate_pending_tocs by string path was unreliable in the full
contract suite, so the real path tried to render a missing pdf and dropped
the pending graft record. Align with toc_graft stubs instead.

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

* fix: drop unused serialize imports from toc rehome contract

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

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Production and debug ZIP packages no longer embed token cost estimates.
Local debug manifests still enrich cost_estimate for operator inspection;
ZipResultService strips any residual cost fields before writing manifest.json.

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

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…al-snapshot-load

fix: harden retrieval snapshot loading
@suguanYang
suguanYang merged commit 9d92a28 into staging Aug 27, 2026
6 checks passed
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