Proof Portal
litellm
BerriAI117 findings · 107 requirementsLiteLLM Python->Rust migration audit (proof mirroring).
Python->Rust divergence: OCR response JSON parse + parse-error re-raise relocated upstream in Rust
Low-severity issue, currently open.
How well is this finding proven?
- 1.Reported / candidate
Complete
- 2.Reproducer written
Complete
View reproducer - 3.Reproduces (recorded run)
Not yet established
View evidence - 4.Independently re-run
Not yet established
- 5.Meets quality standard
Not assessed
- 6.Validated for submission
Not assessed
Recorded runs show whether the issue reproduces. Independent re-runs are shown separately. A later review does not fill in a missing earlier step.
Description
The issue as recorded.
Cross-language parity finding for MIR-001. The Python MistralOCRConfig.transform_ocr_response parses raw_response.json() inline and re-raises on an unparseable body (SW-REQ-260701-2CEW). The Rust core transform (crates/core/src/providers/mistral/ocr/transformation.rs) receives an already-parsed serde_json::Value, so it has no JSON-parse step and no parse-failure path to re-raise; the whole SW-REQ-260701-2CEW obligation set (error_handling, malformed_input, errors_propagated, malformed_recovers_or_errors_loudly, and both parse_error_raised MC/DC rows) plus the DEP5 ocr_response_returned=F,response_parseable=F MC/DC row have no witness in the core transform. The raw HTTP body decode and its parse-error propagation are structurally relocated upstream to the ai-gateway OCR handler (crates/ai-gateway/src/ocr), which is outside MIR-001 target scope. This is an architectural divergence, not a defect: behavior is preserved end-to-end but its home in the module graph differs. No litellm or Rust behavior is changed.
Evidence disposition (issue #392): this finding documents an ABSENCE in the Rust target (litellm-rust/crates/, outside the Python verification_scope in proof.yaml), established by the static grep/read recorded in reproducer_command. There is no runnable Python-scope tripwire that can reproduce a Rust-side absence, so proof evidence refresh cannot stamp a current evidence row. Reviewed and accepted as honest tracked debt below the runnable-reproducer floor; fabricating an evidence hash would be dishonest.
Affected requirements
The requirement(s) this issue violates — click through to the spec.
Port parity
How this finding relates to the port: whether the behaviour diverges, isn't ported yet, was fixed, or matches across both implementations.
- Mistral OCR: Python -> RustMIR-001Diverges on the Rust portPython → RustView in Mirrors
Severity, explained
Why this is rated the way it is — and the scoring signals behind the rating (each ⓘ explains the term).
- why this rating
- Risk-rated
- risk area
- Correctness
- CVE surface
- None
Where it is
The code the issue lives in — peek the affected function inline to see it in context.
- MistralOCRConfig.transform_ocr_response (Python) vs providers::mistral::ocr::transformation::transform_ocr_response (Rust core)
Reproducer and evidence
The recorded reproducer and its evidence-run outcome. Inspect the test and source, or run the command to check the behavior yourself.
// Reproduces: markerread crates/core/src/providers/mistral/ocr/transformation.rs:105-143 (transform_ocr_response takes a pre-parsed Value; no .json() decode); the parse+re-raise live in crates/ai-gateway/src/ocr
Reproduction steps
Technical steps for your engineers to confirm the issue by hand.
read crates/core/src/providers/mistral/ocr/transformation.rs:105-143 (transform_ocr_response takes a pre-parsed Value; no .json() decode); the parse+re-raise live in crates/ai-gateway/src/ocr
What protects you, and the fix
What limits your exposure today, and the planned remediation.
What protects you now
Cover SW-REQ-260701-2CEW parse-error behavior in the ai-gateway OCR handler tests (out of MIR-001 target scope); the core transform correctly has no parse step to witness.
The fix
Audit/divergence finding only. Track the parse-error obligations against the ai-gateway OCR call path; no change to the core transform.
Blast radius
If you touch this issue, what else may need re-checking — the requirements it affects and the code and tests that hang off them. Historical view: authored trace links only — automatically derived links aren't reconstructible for past runs.
Touch this finding and you re-check 2 requirements · 2 code files · 1 tests.
- transformation.rs
- transformation.py
- test_mistral_ocr_transformation.py
Per-requirement evidence
For each requirement this finding touches: the implementing code, verifying tests, and proof obligations that discharge it.
Per-requirement evidence
For each requirement this finding touches: the implementing code, verifying tests, and proof obligations that discharge it.
Change history
Every recorded revision of this finding's source file — when it was added, edited, or re-classified, with the diff for each change.
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.