Vault OCR scan, search and sidecars
State: open/building · Kind: module · Audience: system
Summary
Section titled “Summary”- Extracts text from a vault’s images and PDFs, caches it in one index file, and ranks search hits over it.
- Optionally writes the text back as idempotent .ocr.md sidecar notes.
Statement
Section titled “Statement”The crate scans a vault’s attachments with an injected OCR engine (macOS Vision or tesseract), saves
results to a combined scan cache and search index at the vault’s OCR state dir
(vault_state_dir(<id>, "ocr")/index.json), and skips files that have not changed. It tokenizes,
scores and snippets queries against that index, and writes sidecar notes next to each asset without
rewriting unchanged ones. The engine is a seam, so the whole pipeline runs against a fake engine in
tests. It is a library behind the OcrPort host surface; it has no binary of its own.
What it provides
Section titled “What it provides”- run_scan: walk, OCR, save, sidecars and report, with progress and a cache keyed on file size and mtime
- search_index and search_response: tokenize, score, snippet and rank over the index
- write_sidecar and compose_sidecar: idempotent
.ocr.md write-back - OcrIndex store: bit-exact mtime round-trip shared with the node arm
- config read from _system/ocr.md, validated by determined-contracts
- engine seam with Vision and tesseract adapters, plus a public fake-engine test harness
Underlying implementation
Section titled “Underlying implementation”- solutions/determined/crates/determined-ocr/src/port.rs (RustOcr implements determined_core::ports::OcrPort)
- solutions/determined/crates/determined-ocr/src/engine/
Locations
Section titled “Locations”solutions/determined/crates/determined-ocr/solutions/determined/crates/determined-ocr/src/scan.rs#run_scansolutions/determined/crates/determined-ocr/src/search.rs#search_indexsolutions/determined/crates/determined-ocr/src/sidecar.rs#write_sidecarsolutions/determined/crates/determined-ocr/src/store.rs#OcrIndex