Proof Portal

Project overview

litellm

BerriAI117 findings · 107 requirements

LiteLLM Python->Rust migration audit (proof mirroring).

93 withheld (location undisclosed)

All requirements
RequirementSW-REQ-260701-2CEWSoftwareApproved

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

This requirement changed after its last recorded review, so approval is stale. Automated checks pass and 7/7 obligations are satisfied.
PriorityshallTypeguaranteeCategoryfunctionalComponentmistral_ocrAssuranceEFindingsLowworst open

Specification

The requirement exactly as authored — its complete prose text and, where present, the formal FRETish sentence it compiles to.

Description

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

FRETish formula
when (! response_parseable) the mistral_ocr shall always satisfy parse_error_raised
View full formal model

Verification & provenance

How this requirement was checked: the review trail, edit history, and the machine-analysis status terms (each ⓘ explains what it means).

Assurance levelE
Formalizationvalid
Strategyfretish

Review

Status
approved
Reviewer
Buger · lead_engineer
Reviewed
Jul 1, 2026, 16:42 UTC
“Owner-authorized review: FRETish matches implementation behavior, review gate PASS, obligation evidence complete, code + requirement MC/DC 100%, witnessing tests green”

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

Reviewed Jul 2, 2026, 05:51 UTCby agent:claude-codecatalog v1.3.0
  • 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.

  1. 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 catalogue
Discharged

Behavior when operations fail or dependencies are unavailable.

Discharging evidence2/2 required witnessed
  • negativerequiredpresent
    Covered by 1 test
  • nominalrequiredpresent
    Covered by 1 test
Discharged

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.

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 1 test
Discharged

Behavior when inputs are syntactically or structurally invalid.

Discharging evidence2/2 required witnessed
  • negativerequiredpresent
    Covered by 1 test
  • nominalrequiredpresent
    Covered by 1 test
Discharged

Parsers shall declare their malformed-input policy: either documented recovery (and what is preserved) or loud error with no partial state.

Discharging evidence2/2 required witnessed
  • negativerequiredpresent
    Covered by 1 test
  • nominalrequiredpresent
    Covered 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).

FRETish formula

when (! response_parseable) the mistral_ocr shall always satisfy parse_error_raised

Witnesses· 2 scenarios total

  • test_blocks_and_confidence_scores_preserved
    exercises 1 condition scenario
  • test_response_parse_error_is_reraised
    exercises 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.

Covereda test exercises this rowExempteda reviewed mcdc:ignoreNo-actionfalse-result row satisfied by designUncoveredneeds a covering test
#parse_error_raisedresponse_parseableResultProvesCovering test
1FFFparse_error_raisedExempted · 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)
2FTTresponse_parseable
3TFTparse_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.

Impact

Blast radius — authored trace links only (automatically derived links come from the audit index and aren't shown here).

If you change this

Requirements
0
Files
2
Tests
1
At-risk contracts
0

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.

Sign in to discuss this with the proof team.Sign in