feat(modal-qwen-vl-quad): add footer-strip call to populate comments_raw#36
Merged
Merged
Conversation
The per-quadrant adapter assembled a PageResult from a header call plus four quadrant calls; none of those crops sees the bottom Comments band because `_crop_quadrants` stops at `layout.body_bottom_y` so the printed `Comments:` line does not bleed into the bottom-quadrant transcriptions. With `PageResult.comments_raw` landed in #32 the adapter therefore emitted `comments_raw=None` on every page even when the band had real content. Adds a sixth `transcribe_qwen_vl.remote()` call against `image[body_bottom_y:, :]` inside the existing `with app.run():` block, mirroring the header call's fault-tolerance shape so a footer parse failure leaves `comments_raw=None` without failing the page. Introduces `_crop_footer_strip(image, layout)`, `FOOTER_WIRE_SCHEMA` (analogous to `HEADER_WIRE_SCHEMA` — small, inline, no Pydantic indirection), and `FOOTER_EXTRACTION_PROMPT` (mirrors `HEADER_EXTRACTION_PROMPT`'s scoping discipline: capture verbatim, JSON null for blank, never invent, do not transcribe row content from above the Comments line). The Modal container is warm for calls 2-6, so the cost delta is one warm forward pass per page. Closes #33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
transcribe_qwen_vl.remote()call against the footer strip (image[body_bottom_y:, :]) somodal-qwen-vl-quadpopulatesPageResult.comments_rawinstead of always emittingNone.FOOTER_WIRE_SCHEMAdict, one-line_crop_footer_striphelper, terseFOOTER_EXTRACTION_PROMPT(verbatim, JSON null for blank, do not transcribe row content from above the Comments line), same try/except so a footer parse failure leavescomments_raw=Nonewithout failing the page.test_modal_qwen_vl_quad_*cases to expect 6 calls and assert the 6th payload is wired correctly; add a footer-failure regression analogous to the header-failure case; add a_crop_footer_stripunit test parallel to_crop_header_strip's; add contract tests forFOOTER_EXTRACTION_PROMPTparallel to the header-prompt tests.Test plan
ruff check .passesruff format --check .passesmypy core cli.pypassespytestpasses (339 passed, 1 deselected)PageResultwithcomments_rawset when the band has content,Nonewhen blank (user-driven)Closes #33