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-T821SoftwareApproved

transform_ocr_request raises ValueError when the document is not a dict

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

Specification

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

Description

transform_ocr_request raises ValueError when the document is not a dict

FRETish formula
when (! document_is_dict) the mistral_ocr shall always satisfy value_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:50 UTC · Claude Code · AI agent

Hazard review

Reviewed Jul 2, 2026, 05:50 UTCby agent:claude-codecatalog v1.3.0
  • scenarioreviewedmalformed_input

    Reject-non-dict-document is the malformed_input partition of transform_ocr_request; nominal/error_handling belong to sibling build/response requirements

  • propertyreviewedpure_function_property_tested

    transform_ocr_request is pure (output=f(inputs), no I/O), so its determinism/totality over the non-dict partition are property-testable; accepted pure_function_property_tested

  • structuralreviewed

    Python transform surfaces a typed ValueError (its very guarantee); panic_free keys on the Rust panic scanner and nil_safety is a Go nil-pointer class, so both suppressed as language-mismatched

  • domainreviewed

    This is a PURE in-process transform issuing zero network calls; all external-call/http-client reliability controls belong on the Mistral OCR POST in litellm/ocr/main.py and the base HTTP handler, not on this dict-shape validator

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-5

    transform_ocr_request: line 187 'if not isinstance(document, dict)' raises ValueError at line 188 for any non-dict. FRETish 'when !document_is_dict shall satisfy value_error_raised' matches the negated-isinstance gate driving the raise.

    Cited code (2)

Obligations

What this requirement must witness to be considered satisfied — the required evidence, and the tests that discharge each one.

2 obligations · 2 discharged

Browse the catalogue
Discharged

Behavior when inputs are syntactically or structurally invalid.

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

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.

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 2 tests

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 (! document_is_dict) the mistral_ocr shall always satisfy value_error_raised

Witnesses· 3 scenarios total

  • transform_ocr_request_rejects_non_object_document
    exercises 1 condition scenario
  • test_multiple_new_params_together
    exercises 1 condition scenario
  • test_returns_exact_13_item_allowlist
    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
#document_is_dictvalue_error_raisedResultProvesCovering test
1FFFdocument_is_dictExempted · defensive — a non-dict document always raises ValueError before the body is built, so the trigger-satisfied-yet-no-error state is unreachable in a correct build (reviewed: agent:claude-opus-4-8)
2FTTvalue_error_raised
3TFTdocument_is_dict

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.

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