Repository navigation
feat(docscout)!: read and verify extraction values from page images - #86
Merged
Merged
Conversation
added 16 commits
November 11, 2026 19:23
Read authorized revision-bound pages through the uploads contract. Admit vision models before document work and include image bytes in the existing context budget. Persist visual verification in runs and evaluations. BREAKING CHANGE: page-image evidence uses page, image_checksum and source_revision instead of chunk_id. Text-mode requests, results and saved configurations keep their existing shape.
Merged
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.
Extractors opt into physical page images with
stages.extract.reads = "pages"and a per-callmax_pagesceiling. Extraction and visual verification consume the authorized, revision-bound uploads contract, require vision before document work and include base64 image bytes in the existing context budget. Shared or unproven section boundaries return typed failures. Completeness remains unavailable, withvisual_completeness_unavailable, unless verification receives every eligible page in the field's section intersected with the run's page range; unavailable completeness preserves successful support verification, matching main when optional completeness context cannot be admitted. Unavailable quote or value support still leaves the value unverified.Images already read for a source revision are reused across extraction groups and field checks within that run. The run-local holder retains at most 16 MiB of image bytes and evicts least recently used pages beyond that cap. Active request images are separate from that holder cap. Stages access the holder sequentially. Replaced entries subtract their previous bytes before insertion. The holder is never persisted and ends with the run; model requests still carry their required images. A run stays pinned to its discovered source revision; a source replaced mid-run returns
revision_mismatchon the next uncached read.Runs and evaluation scores persist explicit visual checks and image identities. The UI saves the setting and displays visual verification after saved-result reload. Page-mode admission errors show their API message; text-mode pre-run error handling and result labels remain unchanged.
Supersedes #65. This reimplementation credits the opt-in setting and synthetic vision fixtures from #65 (
2c52c33), replaces its internal uploads helper route, and preserves main's range, provenance and request budgeting behavior.The breaking
!specifically changes the evidence contract for opt-in image results: evidence haspage,image_checksumandsource_revisioninstead of the previously mandatorychunk_id. Consumers assuming every evidence item has a chunk ID must handle the image variant. Text evidence is unchanged. Optional visual metadata is absent from text results. No schema migration or historical rewrite is required. The uploads dependency remains*; integration resolves published uploads 0.3.16 and LLM 0.5.19 without a local uploads replacement.Setting-off identity is proven at the fixture level for backend request bodies, call records, outcomes, field summaries and stored results. The captured baseline covers absent and explicit
textreads, Verify enabled/disabled, and completeness policy absent/false, normalizing generated chunk IDs and latency. This is fixture coverage, not a claim of exhaustive equivalence.Validation:
make buildpass.