OCR batch runs¶
Related: page-result.md, import-run.md, notebook-corpus.md, ocr-multipass.md, public_surfaces.md.
Role¶
OcrBatchRun is a workspace record of “same OCR plan × N notebooks”. The plan is either single-model or multipass (compare models). It does not preallocate page IDs and does not own transcription text. Per-page results remain transcribe.page-result under each notebook. Per-notebook JobCoordinator / MultiPassCoordinator (fingerprint skip, job lock, cancel-after-current-page) are the execution engines.
Bulk import never auto-starts OCR. After an ImportRun commits, the UI may offer Transcribe imported notebooks, which seeds a batch from that run’s committed notebook_ids.
Storage¶
Directory:
{TRANSCRIBE_DATA_DIR}/corpus/ocr-runs/File:
{ocr_run_id}.jsonFormat:
transcribe.ocr-batch-runschema_version:1
Fields¶
Field |
Rule |
|---|---|
|
Stable UUID; filename stem |
|
|
|
When true, inner jobs ignore matching fingerprints |
|
|
|
Ordered vision models; required length ≥2 when |
|
Vision-phase cleanup during multipass (default |
|
Frozen |
|
SHA-256 of canonical |
|
Optional; set when the batch was seeded from an ImportRun |
|
Ordered notebooks; unique |
Item fields¶
Field |
Rule |
|---|---|
|
Locator + display |
|
See item states |
|
Counts from the inner job / multipass vision progress |
|
Optional |
|
Optional; set when a multipass item starts so resume can continue that notebook’s multipass job record |
Item states¶
pending | running | completed | skipped | failed | cancelled
Empty notebooks are
skipped.A notebook that finishes with a mix of succeeded and failed pages is
completedwithpages_failedrecorded (retry those pages later).Crash while
running: resume resets that item topending; for multipass, ifpass_idis set and the job record is incomplete, resume that pass; otherwise start a new pass (fingerprint skip still applies to vision phases).
Execution¶
Resolve each item to a managed notebook root (corpus index, else project-folder scan).
Write frozen settings onto that notebook.
Single:
JobCoordinator.run_blocking. Multipass:MultiPassCoordinator.run_blocking(orresume_blockingwhen resuming an incompletepass_id) with the frozenvision_model_names/ cleanup / auto-activate flags. Per-notebook multipass job records remain under that notebook’sjobs/.One notebook at a time (Ollama is the bottleneck; per-project job lock still applies).
Cancel: stop after the current page (and for multipass, do not start remaining models on that notebook), do not start remaining notebooks (
cancelleditems).
Non-goals¶
Parallel notebooks in one process
Reopening the corpus-integrity acceptance gate
Auto-multipass on import