Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ jobs:
run: cargo test --workspace
- name: Run tests (all features)
run: cargo test --workspace --all-features
- name: Rust OCR model integration
env:
MARKKIT_OCR_MODEL_DIR: ${{ github.workspace }}/target/ocr-models
RTEN_NUM_THREADS: '1'
RAYON_NUM_THREADS: '1'
run: |
python3 scripts/prepare_ocr_models.py
cargo test --release -p markkit --features pdf-ocr-ocrs --test pdf_ocr ocrs_recognizes_scanned_text_with_source_word_geometry -- --include-ignored
- name: Run tests (office formats, no HTTP client)
run: |
if cargo tree -p markkit -e normal | grep -E 'reqwest|hyper'; then
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ jobs:
run: |
pip install target/wheels/*.whl
python -c 'from importlib.metadata import metadata; import markkit; assert metadata("markkit")["Name"] == "markkit"; assert markkit.extract_html_sync("<h1>Smoke</h1>").strip() == "# Smoke"; print("Distribution and import OK")'
- name: Test structured documents and PDF layout
run: python -m unittest discover -s crates/markkit-python/tests -p 'test_*.py'
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Fix root cause. Unsure: read more code; if stuck, ask w/ short options. Unrecogn
| formats/format-support | Formats, bytes-in API, detection order, DOCX + spreadsheet mapping |
| integrations/tool-contract | `MarkkitTool` LLM tool (`tool` feature), Everruns toolkit contract |
| security/security-model | One-page threat/invariant summary |
| security/native-dependencies | Hayro/ocrs provenance, model licensing, native library and host-runtime inventory |
| security/fuzzing | cargo-fuzz targets, S17 oracle, nightly workflow, crash triage |
| security/threat-model | Threats T1-T9, mitigations, test map, resource limits, invariants S1-S21 |
| runtimes/python-package | PyO3 `markkit` module, maturin, PyPI |
Expand Down Expand Up @@ -81,6 +82,9 @@ just bench-criterion # Criterion micro-benches (crates/markkit/benches)
just eval-public-setup # Pinned Mira + isolated Python scorer environment
just eval-public-prepare # Download and verify public corpora (PR slice)
just eval-public # Release WCXB + AgentDocBench runs and regression gate
just eval-pdf # Authored PDF text/layout/table expectations
just ocr-models # Verify optional OCR model assets and attribution
just eval-ocr # Tesseract/ocrs quality, geometry, timing and memory comparison
just pre-pr # Pre-PR checks
```

Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

### Fixed

- PDF stream guards honor escaped dictionary keys and bound compressed prefixes
before image filters, including when OCR is disabled.

- Footnote bodies cannot become unsafe reference-link destinations in Markdown readers
without footnote support. Bodies start after a blank line and remain valid footnotes
in readers that support them (nightly renderer fuzz regression).

### Added

- Optional Rust OCR backend (`pdf-ocr-ocrs`) using ocrs/RTen and explicit local
ONNX model paths. CLI `--ocr-backend ocrs`, Node `pdfOcrBackend`, and Python
`pdf_ocr_backend` select it; Tesseract remains the default. Pinned model setup
and repeated scan comparisons report text quality, geometry, latency and memory.
**Breaking:** exhaustive Rust `MarkkitBuilder` literals also need
`pdf_ocr_backend`, `pdf_ocr_detection_model` and `pdf_ocr_recognition_model`.

- PDF layout, reading order and table extraction: glyph-positioned words,
column reconstruction, ruled tables with merged cells, conservative borderless
tables and wrapped cells; bold/italic, numbered lists, tagged heading roles and
`ActualText`; optional repeated header/footer removal. Layout JSON includes
source runs/words and semantic blocks/lines/cells linked to IR provenance.
- Opt-in native PDF OCR (`pdf-ocr`, CLI `--ocr`) with Rust Hayro rendering and installed Tesseract,
bounded raster size/output/deadline and configurable languages. WASM now supports
PDF text/layout/tables; Node and Python expose layout and native OCR options.
Python gains structured `extract_document_sync`.
- `just eval-pdf`: 20 authored PDF scenes across default/layout modes, including
column, table, wrapped-cell, tagging and list expectations.
**Breaking:** exhaustive Rust `MarkkitBuilder` literals must include `pdf_layout`,
`pdf_remove_repeated_headers`, `pdf_ocr`, and `pdf_ocr_language`; builder methods
and `..Default::default()` remain valid.

- Public WCXB and AgentDocBench evaluations through Mira (`just eval-public`), with
pinned/verified corpora, a release-build baseline regression gate, per-type/format
quality and conversion timings. PR/push runs use a fixed slice; nightly runs cover
Expand Down
Loading
Loading