Skip to content

feat(core): anchor extract, read PDF values by their label - #257

Open
russoedu wants to merge 1 commit into
mainfrom
feat/pdf-anchor-extract
Open

russoedu wants to merge 1 commit into
mainfrom
feat/pdf-anchor-extract

Conversation

@russoedu

Copy link
Copy Markdown
Collaborator

Why

A region extract is a rectangle of coordinates, so a recipe built on one PDF cannot read another document of the same kind whose values sit elsewhere.

What

New kind: "anchor" (PDFs): selector is [page=<n|*>] <right|below> [count=<n>] of <pattern>.

  • Finds the first cell whose text matches the pattern (case-insensitive) on each page.
  • right reads the next count cells on its line; below reads the next count lines in its column.
  • No label, or nothing there, is no match (same rules as region).
  • Schema regenerated; docs in authoring.md §4.6.

Not in this PR

Studio's PDF canvas still writes region. Next: write an anchor from the nearest label, with a live preview and a warning on coordinate-only picks.

Test plan

  • nx run-many -t lint,typecheck,test -p core

🤖 Generated with Claude Code

… anchor extract

An anchor extract finds a cell by its text and reads the cell(s) to its right
or the line(s) below it, so one input recipe reads every document of the same
kind even when the values sit at other coordinates.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014yC6LN4a8qnR7gu3QmRnbg
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