Skip to content

fix(cache): reparse documents when cached media files are missing - #472

Merged
LarFii merged 1 commit into
HKUDS:mainfrom
remote-controlled-man:codex/prflow-b70a400feea9
Nov 12, 2026
Merged

LarFii merged 1 commit into
HKUDS:mainfrom
remote-controlled-man:codex/prflow-b70a400feea9

Conversation

@remote-controlled-man

Copy link
Copy Markdown
Contributor

Description

Parsing an unchanged source can return cached blocks containing dead local paths after parser output files are deleted. Reject that cache entry and run the parser again so the media can be regenerated.

Related Issues

#431 fixes BatchParser manifest reuse when an entire output directory is missing. This fixes the separate parse-cache hit in parse_document, including a missing media file within an existing output directory.

Changes Made

  • Check referenced local image, table, equation, audio and video files before accepting a parse-cache hit.
  • Preserve normal cache reuse, external HTTP/HTTPS/S3 references, cache keys and document IDs.
  • Add public-entry regression coverage, including MinerU output reading and path resolution with its external command stubbed.

Validation

On Python 3.12:

  • Focused cache tests: 22 passed.
  • Full tests/ suite: 1134 passed, 2 skipped, 1 xfailed. The two skipped modules require the optional WeasyPrint dependency, which is not installed in this environment.
  • All-files pre-commit and git diff --check HEAD^ HEAD: passed.
  • Original code fails all 10 missing-file/parent-directory cases and the MinerU image regression.

Checklist

  • Changes tested locally
  • Code reviewed independently
  • Unit tests added
  • Documentation updated (no API or configuration change)

Additional Notes

AI assistance was used for investigation, implementation, testing and independent review. No independent human review is claimed. Native MinerU/model inference and additional platforms were not exercised.

Copilot AI balanced review requested due to automatic review settings November 11, 2026 08:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@LarFii
LarFii merged commit 3b03819 into HKUDS:main Nov 12, 2026
4 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.

3 participants