ci(pdf-extract): add package verification gate - #2723
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 21 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🤖 Keepalive Loop StatusPR #2723 | Agent: Codex | Iteration 0/12 Current State
🔍 Failure Classification| Error type | infrastructure | |
|
Runner dispatch state for codex on PR #2723. Do not edit. |
Keepalive Work Log (click to expand)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0ee3aa25c
ℹ️ 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".
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
🤖 Bot Comment Handler
The agent has been assigned to this PR to address the bot review comments. Instructions for agent
The bot comment handler workflow has prepared context in the artifacts. |
|
Closer review fix pushed in Addressed review feedback:
Local validation:
Post-push readback: head is |
|
Follow-up security review fix pushed in
|
Provider Comparison ReportProvider Summary
📋 Full Provider Details (click to expand)openai
anthropic
Agreement
Disagreement
Unique Insights
🔍 LangSmith Traces |
Closes #2711
Why
PDF text-EXTRACTION is independently reimplemented in four fleet repos with four divergent
result contracts and three OCR strategies (verified by reading source, 2026-06-28, and confirmed by a
fresh clone-grep across all branches — exactly four, none missed):
src/counter_risk/parsers/daily_holdings_pdf.py:81(_extract_textladder pdfplumber→pypdf→OCR).src/pension_data/parser/pdf_pipeline.py:455(parse_pdf_to_funded_input) +src/pension_data/extract/orchestration/fallback.py:53(run_fallback_chain) +db/models/provenance.py.src/inv_man_intake/extraction/providers/base.py:204(ExtractionProviderProtocol;:218MultiModalExtractionProvider) — currentpdf_primary.pyextractor is fixture-grade, not real.utils/extract.py:20(_extract_pdf, pdfplumber→str).Missing/duplicated behavior: items 1–4 of the shape (text-extraction ladder, OCR fallback, orchestration,
result/provenance contract) are rebuilt per repo; a reliability layer (arithmetic/business-rule validation +
cross-check + calibrated confidence) is absent in all four. This is latent fragility + duplicated effort,
not a current break. Grounding:
Code/Audits/2026-06-28-fleet-pdf-extraction-survey.mdand…-methodology.md.A validated scaffold (this design) already exists at
packages/stranske_pdf_extract/with 27 passingdeterministic tests; this issue tracks landing it on
mainand finishing the optional-dep paths.Scope
Land the single-source library
stranske-pdf-extractas a pip-installable subdirectory package inWorkflows at
packages/stranske_pdf_extract/(distribution decision: package, NOT sync-manifest copy-sync —see
packages/stranske_pdf_extract/docs/DESIGN.md§2). The package owns: the generalized result + page-levelprovenance contract (
contract.py, generalizing Pension-Data + Inv-Man-Intake), the provider Protocols + OCRseam + registry (
provider.py), the fallback-ladder primitive (orchestration.py, lifted from Pension-Data),the greenfield reliability layer (
reliability.py), one REAL extractor behind the Protocol(
providers/docling_provider.py, Docling/MIT/local, optional[docling]extra), a pure-python baseline(
providers/text_baseline.py), and the golden-set eval harness (eval/harness.py). Tagpdf-extract-v0.1.0.Non-Goals
.github/sync-manifest.yml— distribution ispip, not copy-sync. The onlysync/doc touch is a note that the package exists and is pip-installed (so a future audit does not "fix" its absence).
tests, or the deliberate-break below not demonstrated, is a failure of this issue.
Tasks
packages/stranske_pdf_extract/onmain(the validated scaffold):pyproject.toml(extrasbaseline,docling,ocr,textract,schema,eval),src/stranske_pdf_extract/{contract,provider,orchestration,reliability}.py,providers/{docling_provider,text_baseline}.py,eval/harness.py,docs/DESIGN.md,README.md, andtests/.tests/into Workflows CI (a non-default job, e.g. extend.github/workflows/selftest-ci.ymlor add a
packages-pdf-extractjob) runningPYTHONPATH=packages/stranske_pdf_extract/src python -m pytest packages/stranske_pdf_extract/tests.pdf-extract-v0.1.0and document the install URLgit+https://github.com/stranske/Workflows@pdf-extract-v0.1.0#subdirectory=packages/stranske_pdf_extractinREADME.md.providers/docling_provider.py:_extract_real) behind the[docling]extra andadd an opt-in test that runs only when
docling_available()is true (skips cleanly otherwise).Acceptance Criteria
packages/stranske_pdf_extract/tests/test_docling_provider.py::test_docling_provider_conforms_to_protocolpasses in CI (asserts
isinstance(DoclingProvider(), MultiModalExtractionProvider)), AND the full package suitecollects a non-zero count and passes (confirmed-green locally: 27 passed).
name = "docling"attribute insrc/stranske_pdf_extract/providers/docling_provider.py(classDoclingProvider). With this change,test_docling_provider.py::test_docling_provider_conforms_to_protocolmust FAIL withassert isinstance(...) == False. Revert and confirm it passes. (Demonstrated locally during scaffolding.)pip install "git+…#subdirectory=packages/stranske_pdf_extract"importsstranske_pdf_extractwith thecore (no extras) and
importofprovidersdoes not requiredocling(onlyextract_modalitiesdoes).Implementation Notes
cd packages/stranske_pdf_extract && PYTHONPATH=src python -m pytest -q→27 passed.consumers install only what they need.
packages/stranske_pdf_extract/docs/DESIGN.md.Automated Status Summary
Scope
PDF text-EXTRACTION is independently reimplemented in four fleet repos with four divergent
result contracts and three OCR strategies (verified by reading source, 2026-06-28, and confirmed by a
fresh clone-grep across all branches — exactly four, none missed):
src/counter_risk/parsers/daily_holdings_pdf.py:81(_extract_textladder pdfplumber→pypdf→OCR).src/pension_data/parser/pdf_pipeline.py:455(parse_pdf_to_funded_input) +src/pension_data/extract/orchestration/fallback.py:53(run_fallback_chain) +db/models/provenance.py.src/inv_man_intake/extraction/providers/base.py:204(ExtractionProviderProtocol;:218MultiModalExtractionProvider) — currentpdf_primary.pyextractor is fixture-grade, not real.utils/extract.py:20(_extract_pdf, pdfplumber→str).Missing/duplicated behavior: items 1–4 of the shape (text-extraction ladder, OCR fallback, orchestration,
result/provenance contract) are rebuilt per repo; a reliability layer (arithmetic/business-rule validation +
cross-check + calibrated confidence) is absent in all four. This is latent fragility + duplicated effort,
not a current break. Grounding:
Code/Audits/2026-06-28-fleet-pdf-extraction-survey.mdand…-methodology.md.A validated scaffold (this design) already exists at
packages/stranske_pdf_extract/with 27 passingdeterministic tests; this issue tracks landing it on
mainand finishing the optional-dep paths.Tasks
packages/stranske_pdf_extract/onmain(the validated scaffold):pyproject.toml(extrasbaseline,docling,ocr,textract,schema,eval),src/stranske_pdf_extract/{contract,provider,orchestration,reliability}.py,providers/{docling_provider,text_baseline}.py,eval/harness.py,docs/DESIGN.md,README.md, andtests/.tests/into Workflows CI (a non-default job, e.g. extend.github/workflows/selftest-ci.ymlor add a
packages-pdf-extractjob) runningPYTHONPATH=packages/stranske_pdf_extract/src python -m pytest packages/stranske_pdf_extract/tests.pdf-extract-v0.1.0and document the install URLgit+https://github.com/stranske/Workflows@pdf-extract-v0.1.0#subdirectory=packages/stranske_pdf_extractinREADME.md.providers/docling_provider.py:_extract_real) behind the[docling]extra andadd an opt-in test that runs only when
docling_available()is true (skips cleanly otherwise).Acceptance criteria
packages/stranske_pdf_extract/tests/test_docling_provider.py::test_docling_provider_conforms_to_protocolpasses in CI (asserts
isinstance(DoclingProvider(), MultiModalExtractionProvider)), AND the full package suitecollects a non-zero count and passes (confirmed-green locally: 27 passed).
name = "docling"attribute insrc/stranske_pdf_extract/providers/docling_provider.py(classDoclingProvider). With this change,test_docling_provider.py::test_docling_provider_conforms_to_protocolmust FAIL withassert isinstance(...) == False. Revert and confirm it passes. (Demonstrated locally during scaffolding.)pip install "git+…#subdirectory=packages/stranske_pdf_extract"importsstranske_pdf_extractwith thecore (no extras) and
importofprovidersdoes not requiredocling(onlyextract_modalitiesdoes).