Repository navigation
Conversation
stages.extract.reads: pages reads values from the upload's page images, with max_pages page images per call. Text stages only choose pages; verification checks each value against its cited page image and records whether the quote agrees with the page's processed text.
Contributor
Author
|
Superseded by #86, merged and released. |
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.
Stacked on #62 (which carries #61, #59, #55, #53). Base branch:
fix/docscout-verified-semantics.What
stages.extract.reads: text | pages(unset =text, today's behaviour) andstages.extract.max_pages(1-32, required whenreads: pages).With
reads: pages:[Page N]label, then the field lines. No passages, scout notes or analyses go in. Evidence is{page: enum of sent pages, quote}.max_pages, it reads them all, with or without passages. This bypasses the empty-passage gate.max_pages, using the existing F4allocate. A field none of whose own pages fit getspage_budget_cut. Recall on long inputs therefore still depends on the text.search_within: sectionsis a page-level boundary: a field reads only the pages that hold chunks of its region (from chunk page spans). A page shared by two regions is visible to both.max_pagesimages and the model window. It shows the cited pages, plus the next page for text and list values, with field description, value, quotes and their pages. Per field it answersquote_on_page,states_value(yes | no | unreadable) and, for text and lists,complete.verifiedrequires bothyes. Otherwise the cause isquote_not_on_page,support_rejectedorsupport_unreadable.check_support, a value read from pages is unverified (unchecked).check_quotes, each quote is matched against the processed text of its page.evidence.text_agreementisagrees | differs | no_text. It is recorded only and never gates.pagesandexcluded_pages.ai.structuredaccepts content parts (text andprompt.image_base64), so the request stays provider-neutral. Theopenai_compatmapper converts image parts toimage_url.Design notes
kickside.uploads.rasterize:page_images.page_set, which covers rendered pages for pages that needed OCR and uniquely numbered page-sized doc2md scans. This is the same definition the rasterizer and OCR share.kickside.uploads:trusted_reader.image_bytesreads the bytes, andsource_imagecovers an image upload.kickside.contract:content_providerhas already admitted the caller to, in the same run.verifiedmeans model-supported visual evidence, and requests carry no document text. A text fallback would change both meanings per page without any visible signal.page_image_unavailable, naming the pages.max_pages, and a provider refusal surfaces as a call error.shapes.group_schemaand the newpage_group_schemashare one builder and differ only in the evidence locator.Not in this PR
source_pagefor uploads sliced from another upload. A Markdown upload created from part of another upload has no page images, and uploads records no parent-page map for it. The parent upload id is used only to freeze execution identity (platform/uploads/src/uploads.luafreeze_current_identity).trusted_reader.image_bytesreads only artifacts of the same upload, andcontent_providerexposesget_contentandget_infoonly. Such an upload reportspage_image_unavailablefor every page until uploads carries a child page map with authorized parent artifacts.Tests
New suite
docscout_pageswith synthetic PNG pages (generated in Lua, printed text in a tEXt chunk) and a vision fixture model. The fixture reads the page images and refuses any request that carries document text or puts a page after the field text. Coverage:text_agreementagrees, differs and no_textpage_image_unavailable, no text fallback)max_pagesrequired withpagesRed on the base: the configuration schema rejects
reads. Gates: lint clean; SQLite 212/212, Postgres 212/212 (base 195); UI vitest 110/110, vue-tsc clean, static rebuilt.check-package-bindings.pyfails the same way as on main (package_selectedincludeskickside.security.groups:members).