Tie annotations to the printed text they mark #101

Closed
opened 2026-11-27 16:48:37 +00:00 by jfro · 0 comments
Owner

Part of #99 (agent plan review).

Problem: read_pages returns handwriting and printed text as separate blobs, with no link between them. There are no stored stroke boxes (lines/stroke.ex:10), and printed text is plain text per page (printed_text/page.ex:15). Highlights are parsed with text and rects (lines/highlight.ex), but nothing consumes them, and OCR skips them (ocr/transcribe_worker.ex:101-103).

Proposal:

  • Extract printed text with positions (line/paragraph boxes) for PDF pages.
  • Group ink into marks (lines/marks.ex already computes boxes) and anchor each to the nearest printed line/paragraph.
  • Expose highlights as data: "highlighted: ".
  • Reuse the issues module's strike-through detection on printed text: "struck through: ".
  • read_pages (or a new read_annotations) returns a list of marks, each with kind (note, highlight, strike, circle/arrow), transcription, and the anchored printed text.

Done when: for a marked-up plan PDF, an agent gets e.g. note beside "Step 3: migrate the DB": "after the backup" and struck through: "Step 5 ...", without guessing from the images.

Part of #99 (agent plan review). **Problem:** `read_pages` returns handwriting and printed text as separate blobs, with no link between them. There are no stored stroke boxes (`lines/stroke.ex:10`), and printed text is plain text per page (`printed_text/page.ex:15`). Highlights are parsed with text and rects (`lines/highlight.ex`), but nothing consumes them, and OCR skips them (`ocr/transcribe_worker.ex:101-103`). **Proposal:** - Extract printed text with positions (line/paragraph boxes) for PDF pages. - Group ink into marks (`lines/marks.ex` already computes boxes) and anchor each to the nearest printed line/paragraph. - Expose highlights as data: "highlighted: <text>". - Reuse the issues module's strike-through detection on printed text: "struck through: <text>". - `read_pages` (or a new `read_annotations`) returns a list of marks, each with kind (note, highlight, strike, circle/arrow), transcription, and the anchored printed text. **Done when:** for a marked-up plan PDF, an agent gets e.g. `note beside "Step 3: migrate the DB": "after the backup"` and `struck through: "Step 5 ..."`, without guessing from the images.
jfro closed this issue 2026-11-27 19:19:35 +00:00
Sign in to join this conversation.
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#101
No description provided.