AI-vision OCR engine for infrastructure-ocr-engine: adapts any infrastructure-ai AiProvider (Anthropic vision, Claude CLI, ...) into an OcrEngine. REMOTE by nature — deliberately does NOT implement LocalOcrEngine, so it cannot be used on the DLP screen path.
| Tier | infrastructure |
| Role | unclassified (baselined) |
| Path | crates/infrastructure/ocr-ai |
| Edition | 2021 |
| Targets | infrastructure_ocr_ai |
| Public items | 6 across 0 modules |
| Tests | 3 |
What it is for
infrastructure-ocr-ai — an AI-vision OcrEngine that adapts any infrastructure-ai AiProvider (Anthropic vision, Claude CLI vision, …) into text recognition.
It sends the image to the provider with an OCR system prompt and returns the provider's transcription.
Deliberately REMOTE — no LocalOcrEngine
This adapter transmits the image to a provider (network API, or a CLI that reads a file). It therefore intentionally does NOT implement `infrastructure_ocr_engine::LocalOcrEngine` — so it cannot be constructed into a DLP consumer bounded on E: LocalOcrEngine. That is the whole point of the split: the "never exfiltrate screen pixels" guarantee is enforced by the type system, not a runtime flag. Use this engine for general OCR (documents, catalog scans), never for the DLP screen sensor.
Capabilities
crate root
infrastructure-ocr-ai — an AI-vision OcrEngine that adapts any infrastructure-ai
| Item |
|---|
pub const DEFAULT_OCR_PROMPT: & str |
AiVisionEngine
infrastructure-ocr-ai — an AI-vision OcrEngine that adapts any infrastructure-ai
| Item |
|---|
pub struct AiVisionEngine |
AiVisionEngine :: fn new(provider : Arc <dyn AiProvider>) -> Self |
AiVisionEngine :: fn with_prompt(mut self, prompt : impl Into <String>) -> Self |
AiVisionEngine :: fn provider_id(& self) -> & 'static str |
AiVisionEngine :: async fn recognize(& self, input : & OcrInput <'_>) -> Result <OcrText, OcrError> |
How to use it
No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.
Module structure
No public modules: the crate root is its whole surface.
Public surface
`crate root`
| Item | What it is |
|---|---|
pub const DEFAULT_OCR_PROMPT: & str | The default OCR instruction sent as the system prompt. |
pub struct AiVisionEngine | An OcrEngine backed by a infrastructure-ai vision provider. |
AiVisionEngine :: fn new(provider : Arc <dyn AiProvider>) -> Self | Wrap a provider (from AiProviderFactory or constructed directly) with the default OCR prompt. |
AiVisionEngine :: fn with_prompt(mut self, prompt : impl Into <String>) -> Self | Override the OCR system prompt. |
AiVisionEngine :: fn provider_id(& self) -> & 'static str | — |
AiVisionEngine :: async fn recognize(& self, input : & OcrInput <'_>) -> Result <OcrText, OcrError> | — |
No pub use re-exports: every item above is declared in this crate.
Boundary
Depends on no other workspace tier.
Shares tier infrastructure with 82 other crates: infrastructure-acquire, infrastructure-adapters-google-calendar, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-adapters-yelp, infrastructure-agent, … (82 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | infrastructure |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/infrastructure/ocr-ai |
| Vocabulary in force (lexicon) | current |
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `infrastructure-ai` | infrastructure | no | always |
| `infrastructure-ocr-engine` | infrastructure | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
async-trait | ^0.1 | — | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tokio | ^1 | full, macros, rt-multi-thread | no | always |
Build. None.
Depended on by. 1 workspace crate.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR n_infrastructure_ocr_provider["infrastructure-ocr-provider"] -->|uses| SELF SELF["infrastructure-ocr-ai"] SELF -->|runtime| n_infrastructure_ai["infrastructure-ai"] SELF -->|runtime| n_infrastructure_ocr_engine["infrastructure-ocr-engine"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| lib | infrastructure_ocr_ai | `src/lib.rs` |
Error model
No public error type was detected: no public item declares a type named *Error, and no public signature returns one.
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | yes |
| async runtime | none detected |
| database access | none detected |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
1 workspace crate depends on this one: infrastructure-ocr-provider.
Verification
| Kind | Count |
|---|---|
| Unit tests | 3 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 2 | 0 | 1 |
What the tests establish, by name:
is_usable_as_dyn_ocr_engine—src/lib.rsrecognizes_via_provider_image_path—src/lib.rsunavailable_provider_maps_to_unavailable—src/lib.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 4 | 6 |
Public modules with a //! block | 0 | 0 |
pie showData
title Public items with rustdoc
"Documented" : 4
"No rustdoc detected" : 2
Metrics
| Metric | Value |
|---|---|
| Rust source files | 1 |
| Source lines | 132 |
| Code lines | 84 |
| Public API items | 6 |
| Public modules | 0 |
| Tests | 3 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 3 |
| Workspace reverse dependencies | 1 |
pie showData
title Public API by kind
"constant" : 1
"method" : 4
"struct" : 1
pie showData
title Rust source composition
"Code" : 84
"Blank or comment" : 48
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.