Proof Portal
litellm
BerriAI117 findings · 107 requirementsLiteLLM Python->Rust migration audit (proof mirroring).
93 withheld (location undisclosed)
transform_ocr_response returns an OCRResponse carrying pages, model, document_annotation, usage_info, and object=ocr when the raw response is response_parseable (parses as JSON AND constructs a valid OCRResponse); the returned record is structurally well-formed (pages is a list, object=ocr)
Specification
The requirement exactly as authored — its complete prose text and, where present, the formal FRETish sentence it compiles to.
transform_ocr_response returns an OCRResponse carrying pages, model, document_annotation, usage_info, and object=ocr when the raw response is response_parseable (parses as JSON AND constructs a valid OCRResponse); the returned record is structurally well-formed (pages is a list, object=ocr)
when response_parseable the mistral_ocr shall always satisfy ocr_response_returned
Verification & provenance
How this requirement was checked: the review trail, edit history, and the machine-analysis status terms (each ⓘ explains what it means).
Review
- Status
- approved
- Reviewer
- Buger · lead_engineer
- Reviewed
- Jul 1, 2026, 16:42 UTC
History
- Created
- Jul 1, 2026, 09:53 UTC · Claude Code · AI agent
- Modified
- Jul 2, 2026, 05:51 UTC · Claude Code · AI agent
Hazard review
- scenarioreviewednominal
- propertyreviewedpure_function_property_tested
- structuralrevieweduntrusted_input_bounded
- domainreviewed
Change history
Every recorded revision of this requirement's source file — newest first, each with its commit message and the diff for that change.
Review history
Human and AI-agent approvals of this requirement — the 'why was this approved' lineage, each with the reviewer's justification and the code it cites.
- UnknownApprovedSpec conformanceJul 1, 2026 · 5 months agoREVIEW-6
transform_ocr_response: the try block (line 232) parses raw_response.json() and returns OCRResponse(pages, model, document_annotation, usage_info, object=ocr) at lines 238-244. FRETish 'when response_parseable shall satisfy ocr_response_returned' models the success path of the try.
Cited code (3)
Open known issues
Findings currently open against this requirement — issues its verification surfaced that are not resolved yet. Each links to the full finding.
- LowOpen
Python↔Rust divergence risk: malformed OCR response handling (fail-loud vs coerce)
KI-ocr-response-coercion-divergence
- LowOpen
Python->Rust divergence: OCR response JSON parse + parse-error re-raise relocated upstream in Rust
KI-ocr-rust-parse-upstream
- LowOpen
Python->Rust OCR response shape divergence: Rust into_json omits the always-serialized null OCRResponse fields (content/tables/keyValuePairs and nested images/dimensions/credits/doc_size_bytes)
KI-rust-ocr-response-shape-omits-null-fields
Obligations
What this requirement must witness to be considered satisfied — the required evidence, and the tests that discharge each one.
3 obligations · 2 discharged · 1 not yet witnessed
Browse the catalogueHappy-path behavior with valid inputs.
- nominalrequiredpresentCovered by 2 tests
A function declared pure (no I/O, no global state, output is f(input) only) shall carry property-based tests that exercise its declared algebraic properties (determinism, totality, commutativity, monotonicity, idempotency — whichever apply); example-based tests alone shall not be sufficient evidence for a pure-function obligation.
- nominalrequiredpresentCovered by 2 tests
Deserialization of untrusted input shall enforce schema, type, and size bounds before any object construction.
- nominalrequirednot yet witnessedRequired evidence not yet witnessed — no covering test recorded.
Formula evidence
The formal formula behind this requirement, the variables it is written over, and the tests that exercise it (each term is explained inline).
Formula evidence
The formal formula behind this requirement, the variables it is written over, and the tests that exercise it (each term is explained inline).
FRETish formula
when response_parseable the mistral_ocr shall always satisfy ocr_response_returned
Witnesses· 3 scenarios total
- transform_ocr_response_normalizes_mistral_jsonexercises 1 condition scenario
- test_blocks_and_confidence_scores_preservedexercises 1 condition scenario
- test_response_parse_error_is_reraisedexercises 1 condition scenario
MC/DC truth table· 3 rows
Each row assigns the formula's conditions (T/F) and shows the Result— the formula's value for that input row, not a test pass/fail. A row proves a condition when flipping only that condition flips the outcome. The test that covers each row is linked.
mcdc:ignoreNo-actionfalse-result row satisfied by designUncoveredneeds a covering test| # | ocr_response_returned | response_parseable | Result | Proves | Covering test |
|---|---|---|---|---|---|
| 1 | F | F | T | response_parseable | |
| 2 | F | T | F | ocr_response_returned | Exempted · defensive — a parseable response always yields an OCRResponse, so the trigger-satisfied-yet-no-response state is unreachable in a correct build (reviewed: agent:claude-opus-4-8) |
| 3 | T | T | T | ocr_response_returned |
Its place
How this requirement connects — what proves it, what it affects, and what it rests on. Authored links only here; automatically derived links come from the audit index.
Loading graph…
Trace evidence
The concrete artifacts linked to this requirement — implementing code, verifying tests, documents, and the findings raised against it.
Mirrors
Ports this requirement participates in — it carries a reviewed exemption on one side, or a finding raised against it is tracked as part of the port.
Mirrors
Ports this requirement participates in — it carries a reviewed exemption on one side, or a finding raised against it is tracked as part of the port.
- Mistral OCR: Python -> RustMIR-001Target issuePython → RustView in Mirrors
Impact
Blast radius — authored trace links only (automatically derived links come from the audit index and aren't shown here).
Impact
Blast radius — authored trace links only (automatically derived links come from the audit index and aren't shown here).
If you change this
Files to re-check (2)
- transformation.rslitellm-rust/crates/core/src/providers/mistral/ocr/transformation.rs
- transformation.pylitellm/llms/mistral/ocr/transformation.py
Tests to re-run (1)
- test_mistral_ocr_transformation.pytests/test_litellm/llms/mistral/ocr/test_mistral_ocr_transformation.py
What this rests on
Discussions
Discuss this with the proof team. Nothing changes in your audit automatically — you open a request and a staff member records any outcome inside the thread.