Repository navigation
Give the coarse profile scanning evidence and probe images in one pass - #607
Merged
Merged
Conversation
The coarse profile decides is_scanned from page screenshots, but since the asset probe moved after it the model saw no image measurements, every page labelled "normal" (defined as having native text) and every textless page as blank-like. A clean scan such as TAOCP was judged digital in 2 of 5 runs. - The text probe now records image coverage and image count, so the coarse call sees them; doc_stats adds invisible-text and image-coverage distributions (no sampling extrema). - The coarse prompt explains the evidence: a page is scanned when its screenshot shows clearly more text than its visible text layer holds and images cover most of it; a matching visible text layer means digital. Sampled page rows add invisible text, image coverage and image count and drop the text-only blank flag. - The geometry-only page kind "normal" is renamed "portrait"; persisted labels other than landscape still read as portrait. - Image placements come from one get_image_info pass instead of a get_image_rects call per image, in both probes (TAOCP asset probe 16s -> 0.15s; has_asset unchanged on all pages of four test documents). TAOCP is now judged scanned in 10 of 10 runs; Sydney, a standards document and a slide deck stay digital in 18 of 18. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eout test The test bounded the whole worker run, settlement included, by the budget plus 0.32s. The settlement's database work takes about 0.1s locally but 0.8s on the CI runner, so the test failed there without any regression. It now measures how long the blocked native wait lasted and asserts the deadline ended it before its own end. Settlement keeps its own deadline; missing it makes the run return "pending", which the test already rejects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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
invisible_text_length,image_coverage,image_countand drop the text-onlyis_blank_likeflag;doc_statsadds invisible-text and image-coverage distributions (statistics only, no sampling extrema).is_scannedis decided from screenshots and measurements together: a page is scanned when its screenshot shows clearly more text than its visible text layer holds and images cover most of it; a visible text layer that matches the screenshot means digital, even with large images. No thresholds or document-specific examples.normal(defined as "enough native text", which misled the model on scans) is nowportrait. Persisted labels other thanlandscapestill read asportrait.page.get_image_info()instead of oneget_image_rectscall per image, in the text probe and the asset probe. The asset probe only derives thehas_assetgate; boxes are not kept.Why
Since the asset probe moved after the coarse call, the model saw no image data, every page labelled as having native text, and every textless page as blank-like. TAOCP (clean scan, no text layer) was judged digital in 2 of 5 runs.
Verification
is_scanned(deepseek-flash)has_assetpages (TAOCP / Sydney / standards / deck)make checkpasses.tests/unit+tests/contract: 1066 passed, 3 skipped, 1 failed:test_pymupdf_child_runs_below_worker_priority_and_reports_its_cpufails the same way on cleanmainin a full run (passes alone); it is order-dependent and unrelated to this change.🤖 Generated with Claude Code