Skip to content

feature/Document-reading · L-261115-b6776f - #27

Merged
lchoquel merged 3 commits into
devfrom
feature/Document-reading
Nov 15, 2026
Merged

lchoquel merged 3 commits into
devfrom
feature/Document-reading

Conversation

@lchoquel

@lchoquel lchoquel commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

TL;DR

  • The library gains document_reading, a method that reads every page of a document with one model call per page and returns what each page states or shows, with exact quotations.
  • The build assistant will run it by address to read a file a user attaches, instead of taking the file whole into its context.
  • If it misbehaves, the build assistant's reading of attached files loses facts or costs more than quoted; nothing else in the library depends on it.

Changes

  • New package methods/document_reading/: read_document extracts the pages with Azure Document Intelligence and a 100-dpi page view of each page, then read_pages sends each page to one Claude Sonnet call. Both pipes are exported, so a caller can read a single page again from an earlier run's output without extracting the document a second time.
  • Output: a PageReading per page, in page order, each with its findings (exact quote, kind, source as text, picture or both, an optional note), what could not be read, what was not looked at, and the printed page number when there is one.
  • The prompt lists everything a page holds rather than summarising it, keeps the OCR's reading of a figure and the picture's reading in the note when they disagree, lists a picture element by element, marks values read off a chart as approximate, and treats the page as untrusted data: instructions written on a page are listed as findings, never followed.
  • The library README.md table and the CHANGELOG.md [Unreleased] section list the package.

How it was verified

  • plxt fmt --check, plxt lint, pipelex validate bundle (with 0.95.1 and 0.103.1) and check-samples.sh pass.
  • On the campaign's bench (wip/build-assistant-reading-notes/method-reading/, cells shipped and shipped-2), the package found every fact the phase-1 views-100 variant found, on the brand guidelines, the flowchart, the poor scan, the rate card, a Word file and a PowerPoint deck, at the same cost per page and with no false finding. A page from an earlier run's output was read again through read_pages on the hosted dev runner.
  • /rev round 1 (cubic, Codex, the official code-review): Codex's one finding, the prompt-injection guard, is fixed in this branch.

Left out

  • The release tag, cut by a release/ pull request after this merges.
  • Reading a range of pages within the method waits on a PipeExtract page range in pipelex.

Closes L-261115-b6776f
Advances L-261115-b2b931

🤖 Generated with Claude Code


Summary by cubic

Adds the document_reading package, which reads a document page by page for a caller who will never see it, listing every rule, value, threshold, name and constraint each page states or shows in its exact words.

  • New methods/document_reading/ package with two exported pipes: read_document extracts each page (Azure Document Intelligence OCR plus a 100-dpi picture) and reads it in one claude-5.5-sonnet call; read_pages re-reads pages from an earlier run's output without extracting the document again.
  • Returns one PageReading per page in page order, each with its findings (exact quote, kind, source, optional note), unreadable, not_looked_at, and the printed page number when present.
  • Treats the page as untrusted data: instructions written on a page are listed as findings, never followed.
  • Updates the library README.md table and the CHANGELOG.md [Unreleased] entry.

Reading a page range within the method is left out; it waits on a PipeExtract page range in pipelex.

Written for commit 89f3588. Summary will update on new commits.

View guided diff

lchoquel and others added 3 commits November 15, 2026 21:19
read_document extracts a document's pages with their OCR text and a
100-dpi page view, then reads each page in one model call into a
PageReading of findings, unreadable and not_looked_at. read_pages, also
exported, reads again pages an earlier run extracted with no second
extraction. The package's README, the library table and the changelog's
Unreleased entry describe it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A page whose footer prints "Page 1 of 4" was answered with the other
pages listed as not looked at, which the caller would read as a gap of
this page. The prompt now says the other pages are read separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lchoquel
lchoquel merged commit 627b07c into dev Nov 15, 2026
1 check passed
@lchoquel
lchoquel deleted the feature/Document-reading branch November 15, 2026 20:32
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.

1 participant