Repository navigation
v0.4.0-dev feat: add coordinate-aware vector OCR routing - #7
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 075d9250a8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (values[0] <= 0) { | ||
| self.builder.unknown(); | ||
| self.graphics.paint_state.geometry_known = false; |
There was a problem hiding this comment.
Accept zero-width PDF hairlines
When a valid content stream uses 0 w (the PDF hairline width), this branch marks the graphics geometry unknown. Every subsequent path in that graphics state is then discarded, including filled outlined lettering that does not depend on stroke width, so vector OCR routing can silently miss visible text until a matching Q restores the state. Treat zero as a valid width and conservatively bound only the affected strokes.
Useful? React with 👍 / 👎.
| .unexplained_vector => "unexplained_vector", | ||
| .vector_evidence_limited => "vector_evidence_limited", |
There was a problem hiding this comment.
Include vector reasons in debug SVG output
Adding names here does not make them appear in debug SVG: writeReasonCsv still iterates a fixed list ending at formula_route_stub. Consequently, vector-routed rectangles omit unexplained_vector and vector_evidence_limited from data-reasons, losing the newly added routing provenance in this output format; add both enum values to that enumeration.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
Summary
Outlined text can be visible in a PDF while absent from native text extraction.
This change collects bounded painted-path evidence, excludes simple graphics
and shapes accounted for by clipped native text, and records explainable
regional OCR candidates in schema 0.19. Candidates reuse covering bitmap crops
and require recognized text within their own bounds before recovery is reported.
The combined schema 0.18/0.19 continuation also adds page geometry and raster
transforms for declared quarter turns, CropBox and UserUnit. Public boxes stay
in raw PDF coordinates, while JavaScript helpers map them to display space.
Recognized word order, exact source text, chunks and locators remain preserved.
Rotated inferred tables stay withheld pending topology qualification.
The parser remains
0.4.0-dev; this PR does not tag or publish a release.Geometric candidates and successful OCR do not prove visual completeness.
Vector-lexer bounds exclude initial decompression and whole-process memory.
Validation
The retained uncached run passed 3,774/3,784 tests with ten documented skips.
tests, actual outlined-text OCR in both JSONL formats, and crop cleanup.
CI now runs test files serially after an observed parallel startup deadline.
reproduce byte-for-byte. Both SDK readers pass 36 corpus documents plus
three OCR-enabled controls; adaptive evaluation and existing text/OCR floors pass.
controls across both formats. OCR subprocess memory and whole-Python-process
shutdown remain unqualified;
memcheck_provenremains false.Review
Regression fixes cover native clip suppression, exhausted coverage accounting,
and disjoint OCR output in a reused bitmap crop. Consolidated read-only review
of all 92 changed files at
075d925found no actionable findings. Its freshchecks passed 310 selected JavaScript tests, 28 Zig tests and fixture identity
checks. Review used a separate inherited-model context; no model diversity is
claimed. All six remote CI checks passed at the same head: native gates,
WASM, both Python wheel jobs, adaptive OCR quality and Memcheck boundaries.
Documentation
Output-schema and adapter documentation describe geometry, nullable vector
evidence, counters, work limits, candidate/request links and recovery semantics.
The changelog records this development continuation and its qualified limits.