read_pages: tie the marks on a PDF page to the printed words they mark #106

Merged
jfro merged 1 commit from feat-101-anchored-marks into main 2026-11-27 19:19:35 +00:00
Owner

What changed

PR #106 makes read_pages list each mark on a written PDF/EPUB page with the printed words it marks (highlight, strike, underline, circle, note beside a line), using pdftotext word boxes and no new deps. The red-then-green test (C4) covers the issue's example, and CI is green (C5).

Fixes #101

Red, then green

  • read_pages on a marked-up plan PDF lists each mark with the printed words it marks: highlighted "freeze writes", underlined "take a backup", note beside "Step 3: migrate the DB": "after the backup", circled "switch", struck through "Step 5: delete the old cluster"; and when the transcription doesn't pair with the notes, notes point to it instead of guessing.: bash -c 'source ~/.rmenv && mix test test/rm_analyzer_web/notes_mcp_agent_test.exs'
    • fails on the base (9c293f5): exit 1
    • passes on the branch (1510f04): exit 0

Checks

  • CI on PR #106 (head 1510f04) is green: unused-deps check, warnings-as-errors compile, format check and the full test suite. (Upper Wolfjaw): curl -s -H "Authorization: token $FORGEJO_TOKEN" https://git.knope.dev/api/v1/repos/jfro/rm-analyzer/commits/1510f04/status | jq -e '.state == "success"', exit 0
  • Read the diff at 1510f04 and ran the full suite in my own worktree (1597 passed); pdftotext/blob failures fall back to no marks, and merge only runs CI so it isn't live. Untested: real tablet ink (strike vs underline thresholds), EPUB ligature PDFs. (Prover): bash -c 'source ~/.rmenv && cd /home/peak/scratch/p101 && mix test test/rm_analyzer_web/notes_mcp_agent_test.exs', exit 0

Shipping it

  • Goes live when it merges: no. Merging to main only runs CI; images are built from v* tags by Jeremy's own release run.
  • Undo: a revert puts it back.
  • Not tried on the real thing: Real handwriting on a real marked-up PDF from Jeremy's tablet: the fixtures are synthetic strokes on a Typst-made plan PDF, so thresholds (strike vs. underline, note grouping) are untested on real ink.
  • For later: Arrows aren't a kind of their own (they join the note they're drawn from). Word boxes use raw pdftotext text, so EPUB-made PDFs with lost ligatures show them unrepaired in marks. pdftotext runs per written page on each read (not cached).

Prover

Passed (Sonnet): Read the diff at 1510f04 and ran the full suite in my own worktree (1597 passed); pdftotext/blob failures fall back to no marks, and merge only runs CI so it isn't live. Untested: real tablet ink (strike vs underline thresholds), EPUB ligature PDFs.

Every command above was run by Fortysix's Basecamp itself, on the branch named.

## What changed PR #106 makes read_pages list each mark on a written PDF/EPUB page with the printed words it marks (highlight, strike, underline, circle, note beside a line), using pdftotext word boxes and no new deps. The red-then-green test (C4) covers the issue's example, and CI is green (C5). Fixes #101 ## Red, then green - read_pages on a marked-up plan PDF lists each mark with the printed words it marks: highlighted "freeze writes", underlined "take a backup", note beside "Step 3: migrate the DB": "after the backup", circled "switch", struck through "Step 5: delete the old cluster"; and when the transcription doesn't pair with the notes, notes point to it instead of guessing.: `bash -c 'source ~/.rmenv && mix test test/rm_analyzer_web/notes_mcp_agent_test.exs'` - fails on the base (9c293f5): exit 1 - passes on the branch (1510f04): exit 0 ## Checks - CI on PR #106 (head 1510f04) is green: unused-deps check, warnings-as-errors compile, format check and the full test suite. (Upper Wolfjaw): `curl -s -H "Authorization: token $FORGEJO_TOKEN" https://git.knope.dev/api/v1/repos/jfro/rm-analyzer/commits/1510f04/status | jq -e '.state == "success"'`, exit 0 - Read the diff at 1510f04 and ran the full suite in my own worktree (1597 passed); pdftotext/blob failures fall back to no marks, and merge only runs CI so it isn't live. Untested: real tablet ink (strike vs underline thresholds), EPUB ligature PDFs. (Prover): `bash -c 'source ~/.rmenv && cd /home/peak/scratch/p101 && mix test test/rm_analyzer_web/notes_mcp_agent_test.exs'`, exit 0 ## Shipping it - Goes live when it merges: no. Merging to main only runs CI; images are built from v* tags by Jeremy's own release run. - Undo: a revert puts it back. - Not tried on the real thing: Real handwriting on a real marked-up PDF from Jeremy's tablet: the fixtures are synthetic strokes on a Typst-made plan PDF, so thresholds (strike vs. underline, note grouping) are untested on real ink. - For later: Arrows aren't a kind of their own (they join the note they're drawn from). Word boxes use raw pdftotext text, so EPUB-made PDFs with lost ligatures show them unrepaired in marks. pdftotext runs per written page on each read (not cached). ## Prover Passed (Sonnet): Read the diff at 1510f04 and ran the full suite in my own worktree (1597 passed); pdftotext/blob failures fall back to no marks, and merge only runs CI so it isn't live. Untested: real tablet ink (strike vs underline thresholds), EPUB ligature PDFs. Every command above was run by Fortysix's Basecamp itself, on the branch named.
feat(mcp): read_pages ties the marks on a PDF page to the printed words they mark
All checks were successful
CI / test (pull_request) Successful in 1m53s
1510f04c72
Reads the printed page's word boxes with pdftotext -bbox-layout and places
them as the tablet places the PDF. Highlights, strike-throughs, underlines
and circles list the printed words they cover; the rest of the ink is
grouped into notes, each tied to the printed line it's beside, above or
below, with its words from the transcription when its lines pair up.

Closes #101
jfro merged commit d14a89ba4a into main 2026-11-27 19:19:35 +00:00
jfro deleted branch feat-101-anchored-marks 2026-11-27 19:19:35 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfro/rm-analyzer!106
No description provided.