Fix concrete pipeline bugs and add fast unit-test CI - #13
Merged
Conversation
Correctness fixes so `dvc repro` and CI work on a clean checkout: - layout_detector: replace hardcoded /Users/HemanthRayudu absolute paths with relative data/raw so the layout stage runs off the original author's Mac. - metadata_storage_formats: replace hardcoded C:\Users\Pauline Windows paths with relative data/parsed paths. - sec_downloader: organize downloads by filing type (data/raw/<TYPE>/) so the extractors, which read data/raw/10-K|10-Q/, find their inputs; handle Google Drive's large-file confirmation interstitial; validate downloads are real PDFs (%PDF magic) instead of silently saving HTML error pages as .pdf. - dvc.yaml: point the download stage `outs` at data/raw/10-K/ and data/raw/10-Q/ so the DVC graph matches what is actually produced and consumed. - Remove stale duplicate PDFs under data/raw/META/ (byte-identical to the canonical copies under 10-K/ and 10-Q/). - Replace deprecated datetime.utcnow() with datetime.now(timezone.utc). Testing: - smoke.sh: check the real docling output path (data/parsed/docling/) and drop `dvc repro --pull` since no DVC remote is configured. - Add fast, dependency-light unit tests (tests/unit) covering downloader path layout, Google Drive handling, PDF validation, plus static regression guards for the fixed bugs. All 15 pass. - Add CI workflow running the unit suite as the required gate; move the heavy full-pipeline smoke test to manual (workflow_dispatch). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D68SAeZ9GofWeNdMwvuDwC
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
Fixes a set of concrete, correctness-affecting bugs that prevented
dvc reproand CI from working on a clean checkout, and adds a fast, dependency-light test suite that actually passes as a CI gate.These are the fixes from the earlier system review — scoped to correctness and testing only. Larger architectural work (consolidating on Docling, rebuilding the evaluation set with authoritative ground truth, fixing the XBRL matching logic, README accuracy) is intentionally not in this PR and is left as documented follow-up.
Correctness fixes
layout_detector.py: replaced/Users/HemanthRayudu/.../data/raw(2 places) withdata/raw.metadata_storage_formats.py: replacedC:\Users\Pauline\...paths with relativedata/parsedpaths.data/raw/META/, but every extractor reads fromdata/raw/10-K/anddata/raw/10-Q/. The downloader now organizes output by filing type, anddvc.yaml's downloadoutswere updated todata/raw/10-K/+data/raw/10-Q/so the DVC dependency graph matches what is produced and consumed.%PDFmagic bytes — otherwise it discards the file and reports failure instead of leaving an HTML error page named*.pdf.data/raw/META/*.pdf(byte-identical duplicates of the canonical copies under10-K/and10-Q/).datetime.utcnow()withdatetime.now(timezone.utc)(removed in newer Python).Testing
tests/smoke.sh: now checks the real Docling output path (data/parsed/docling/, previouslydocling_or_fallback/which the pipeline never produces) and dropsdvc repro --pullsince no DVC remote is configured (.dvc/configis empty).tests/unit/— fast tests with no heavy dependencies (no torch/docling/pdfplumber):utcnow, smoke-test path correctness, DVCoutsalignment)..github/workflows/ci.ymlrunning the unit suite as the required per-PR gate; moved the heavy full-pipeline smoke test toworkflow_dispatch(manual) since it needs network + the heavy extraction stack.All 15 unit tests pass locally (
python -m pytest).Notes
dvc.lockstill references the olddata/raw/META/output. I did not hand-edit its hashes; it will be regenerated on the nextdvc repro.🤖 Generated with Claude Code
Generated by Claude Code