Proof Portal
litellm
BerriAI117 findings · 107 requirementsLiteLLM Python->Rust migration audit (proof mirroring).
93 withheld (location undisclosed)
transform_ocr_response re-raises the underlying exception when the raw response is not response_parseable (JSON parse failure OR OCRResponse schema-validation failure), failing loud with no coerced/partial result
Specification
The requirement exactly as authored — its complete prose text and, where present, the formal FRETish sentence it compiles to.
transform_ocr_response re-raises the underlying exception when the raw response is not response_parseable (JSON parse failure OR OCRResponse schema-validation failure), failing loud with no coerced/partial result
when (! response_parseable) the mistral_ocr shall always satisfy parse_error_raised
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
- scenarioreviewederror_handlingmalformed_input
Re-raise-on-parse-failure is an error/malformed-input path over a third-party API response; error_handling and malformed_input both apply. empty_input/boundary/concurrent/access_denied do not: single synchronous call, no auth, no concurrency, no numeric limits.
- domainreviewederrors_propagatedmalformed_recovers_or_errors_loudly
Applied errors_propagated (the underlying exception must propagate, not be swallowed) and malformed_recovers_or_errors_loudly (fail loud, no partial state) as the exact hazards. Suppressed the external_call/http_client reliability set (external_call_timeout_bounded, _concurrency_bounded, _failure_observable, upstream_budget_coordinated, cert_validation_strict, redirect_policy_explicit): this is a process_local transform doing no network I/O, so those controls live on the Mistral HTTP call in litellm/ocr/main.py. Suppressed untrusted_input_bounded/denial_of_service_resistant/panic_free_input_handling/pure_function_property_tested as out-of-scope for a narrow re-raise guarantee. Crypto/IPC/SQL/websocket/filesystem/scheduler classes not applicable.
- propertynot applicable
This is a single error-path guarantee (re-raise on parse failure), not an algebraic-invariant claim. determinism/idempotency/commutativity/monotonicity/totality/invariant_preservation do not pertain; atomicity (no partial state on failure) is already carried by the applied malformed_recovers_or_errors_loudly domain class.
- structuralnot applicable
Python transform; the structural classes are C/C++/Rust language-safety (pointer_arithmetic_bounded, format_string_constant, manual_memory_ownership_clear) or input-shape concerns (nil_safety/overflow_safety/encoding_safety) not raised by re-raising an exception from httpx.Response.json(). No manual memory, pointers, format strings, or numeric overflow on this path.
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-7
transform_ocr_response: the except clause (around line 246) logs and 're-raises e' when raw_response.json() throws (unparseable body). FRETish 'when !response_parseable shall satisfy parse_error_raised' models the except path; the try/except is the parseable/unparseable decision.
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.
Obligations
What this requirement must witness to be considered satisfied — the required evidence, and the tests that discharge each one.
4 obligations · 4 discharged
Browse the catalogueBehavior when operations fail or dependencies are unavailable.
- negativerequiredpresentCovered by 1 test
- nominalrequiredpresentCovered by 1 test
Errors from called functions shall be propagated to the caller (or transformed into a typed error); they shall not be silently dropped, swallowed, or downgraded to a default value.
- nominalrequiredpresentCovered by 1 test
Behavior when inputs are syntactically or structurally invalid.
- negativerequiredpresentCovered by 1 test
- nominalrequiredpresentCovered by 1 test
Parsers shall declare their malformed-input policy: either documented recovery (and what is preserved) or loud error with no partial state.
- negativerequiredpresentCovered by 1 test
- nominalrequiredpresentCovered by 1 test
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 parse_error_raised
Witnesses· 2 scenarios total
- 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| # | parse_error_raised | response_parseable | Result | Proves | Covering test |
|---|---|---|---|---|---|
| 1 | F | F | F | parse_error_raised | Exempted · defensive — an unparseable response always re-raises, so the trigger-satisfied-yet-no-error state is unreachable in a correct build (reviewed: agent:claude-opus-4-8) |
| 2 | F | T | T | response_parseable | |
| 3 | T | F | T | parse_error_raised |
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-001DiffersPython → 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.