Work / Chitragupt / Wiki / Flows
document-lifecycle-ocr
Flowcanonicalverified 2026-06-26
FLOW.DOCUMENT-LIFECYCLE.OCRFlow — Document lifecycle · OCR path
Summary
A document detected as a scanned PDF (needs_ocr) waits for the user to re-upload a sharper scan or to trigger rescanDocument; the parser then re-runs.
Audience
end-user
Entry
Document marked needs_ocr from the document-lifecycle-ingest branch or document-lifecycle-upgrade-backfill.
Steps
| # | Step | Surface | Notes |
|---|---|---|---|
| 1 | Document is needs_ocr |
review-document | Inbox shows "Sharper scan needed" with a Sync button |
| 2a | User re-uploads sharper scan | inbox-uploading | Storage trigger re-runs the paid branch of document-lifecycle-ingest |
| 2b | User taps Sync (rescanDocument) |
review-document | Parser re-runs in place |
| 3a | Still scanned | review-document | Stays needs_ocr |
| 3b | Unknown form type | review-confirm-doc | → needs_classification — see document-lifecycle-classification |
| 3c | Parsed OK | review-document | → unreviewed — see document-lifecycle-standard-review |
Exit
Document moves to unreviewed (or needs_classification); the standard review path can run.
Escapes
- Confirm gate:
needs_ocris NOT confirmable (fields are absent). Confirm button hidden — see the shared rule in document-lifecycle-ingest. - Repeated still-scanned outcome: user must obtain a sharper scan; no auto-resolution.
- Encrypted/locked PDF surfaces: routes to review-document-locked instead.
- Terminal
rejected_format: if rescan reveals an unparseable container, transitions per shared terminal-states table in document-lifecycle-ingest.
Sources
- .context/wiki/flows/* § "Flow 12 — Document lifecycle state machine" · "C. OCR path"
Every project of mine is written down like this.
Read the résumé