feat: add reusable document parsers and parse jobs - #151
Open
francisrafal wants to merge 7 commits into
Open
Conversation
Contributor
Author
|
Verified locally on macOS 26.5.2 (Apple Silicon, arm64) at commit
The PR works locally on macOS for the full repository E2E path. |
Separate extraction and parsing into explicit resources so each workflow can evolve without overloading the legacy jobs contract. Add parser CRUD, durable parse jobs, canonical page-based Markdown results, fair worker scheduling, CLI and Web support, data-preserving migrations, and generated public documentation while retaining /v1/jobs as a deprecated compatibility alias through v0.3.
Exercise parser CRUD and both canonical job resources over the real API and worker while keeping inference costs bounded. The suite now uses exactly one extraction job and one parse job for model-bound coverage and validates the remaining routes without extra LLM requests.
Use a sanitized Markdown pipeline so document and per-page previews render tables, links, formatting, and safe embedded HTML while the raw view remains unchanged. Style the rendered document for readable review and represent unavailable generated image assets without broken images.
Lower the default per-page output budget below the smallest bundled context and pass the setting through Docker Compose so local parsing remains valid and configurable. Regenerate the public references and align the Web settings copy with the new safe default.
Derive canonical JPEG and PNG media types from accepted file extensions so uploads with missing or generic browser metadata still reach vision models as image inputs.
Scope asynchronous job refreshes to the latest parser, poll through parser lists so completed deletions disappear, and remove accepted deletions optimistically. Derive Markdown download names from each job's source file and cover the race and deletion paths in the Web suite.
Move the byte-for-byte alias comparison after polling so worker state transitions cannot produce two valid but different snapshots.
francisrafal
force-pushed
the
francisrafal/parser-jobs
branch
from
August 9, 2026 18:43
d787404 to
c917ac9
Compare
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
/v1/parsers, durable asynchronous jobs at/v1/parse-jobs, and the prebuiltdocument-to-markdownparser/v1/extraction-jobsthe canonical extraction resource while retaining/v1/jobsas a deprecated v0.3 compatibility alias scheduled for removal in v0.4contentandpage_count, with snapshotted parser configuration and provider/model/adapter execution metadataCompatibility and migration
jobstable toextraction_jobs/v1/jobsclients continue to work during v0.3 and see the same extraction-job representationPARSEHAWK_PARSING_MAX_TOKENSbudget, defaulting to 8192E2E strategy
The E2E suite covers the new parser and parse-job API surface while keeping model-bound work deliberately small: exactly one real extraction job and one real parse job. Parser CRUD, aliases, filters, file types, terminal cancellation, deletion, and validation are covered without additional LLM requests.
Verification
parsehawk restarton Linux x86_64 with an NVIDIA L4 and the bundled NuExtract runtimejust check— 411 Python tests, 100% core coverage, OpenAPI and generated references in sync, docs typecheck/build/link validation, 36 Web tests, and Web production buildjust e2e— 17 passed, including the real parse-job executionosv-scanneris unavailable; the bundled-image manifest check passed and CI runs the dependency scanmacOS Apple Silicon runtime verification was not available in this environment.
Closes #20