Proof Portal

Project overview

litellm

BerriAI117 findings · 107 requirements

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

93 withheld (location undisclosed)

All requirements
RequirementSW-REQ-260730-327PSoftwareReview

mock_response maps each mock-response directive string to its outcome per the mock_response_dispatch table: the internal-server, context-window-exceeded, and rate-limit sentinel directives each raise their mapped typed litellm exception, and any other directive returns a well-formed AnthropicMessagesResponse carrying the directive text

All automated checks pass and 3/3 obligations are satisfied. Human review is still pending.
PriorityshallTypeguaranteeCategoryfunctionalComponentanthropic_messagesAssuranceEFindingsnone open

Specification

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

Description

mock_response maps each mock-response directive string to its outcome per the mock_response_dispatch table: the internal-server, context-window-exceeded, and rate-limit sentinel directives each raise their mapped typed litellm exception, and any other directive returns a well-formed AnthropicMessagesResponse carrying the directive text

FRETish formula
the anthropic_messages shall always satisfy mock_directive_dispatched
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
pending

History

Created
Jul 30, 2026, 20:39 UTC · Claude Code · AI agent
Modified
Aug 1, 2026, 18:42 UTC · Claude Opus 4 8 · AI agent

Hazard review

Reviewed Aug 1, 2026, 18:42 UTCby agent:claude-opus-4-8catalog v1.9.1
  • scenarioreviewednominalerror_handling

    nominal is the well-formed-response path for an ordinary directive; error_handling is the three sentinel directives that raise their mapped typed exception. malformed_input is suppressed because every directive is a valid string and the unknown-directive case is defined behavior (returns a response), not a rejected malformed input

  • propertynot applicable

    mock_response is a finite enum dispatch over the directive value (modeled by the mock_response_dispatch decision table), not an algebraic pure-function property surface; determinism/idempotency/totality have no accumulation or ordering referent here

  • structuralnot applicable

    Garbage-collected Python conditional chain with no manual memory, pointer arithmetic, overflow, or format string

  • domainnot applicable

    The mapped exceptions are constructed in-process and raised; no network/filesystem/IPC call is issued, so the external-call and http-client domain classes have no construct to bind to

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. Claude Code · AI agentApprovedSpec conformanceJul 30, 2026 · 4 months agoREVIEW-12

    mock_response lines 76/82/88 dispatch the three sentinel directives ('litellm.InternalServerError' -> InternalServerError, 'litellm.ContextWindowExceededError' -> ContextWindowExceededError, 'litellm.RateLimitError' -> RateLimitError), each raising its mapped typed exception; line 94 returns a well-formed AnthropicMessagesResponse for any other directive. Matches the mock_response_dispatch decision table and the mock_directive_dispatched guarantee.

    Cited code (4)

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

Happy-path behavior with valid inputs.

If it were violatedLow

If an ordinary directive raised instead of returning a well-formed AnthropicMessagesResponse, mock and test flows exercising the happy path would crash instead of receiving the mocked message.

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

Behavior when operations fail or dependencies are unavailable.

If it were violatedMedium

If a sentinel directive returned a normal response instead of raising its mapped typed exception, or raised the wrong type, error-injection tests would silently pass and downstream retry/fallback logic keyed on the exception class would misroute.

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

the anthropic_messages shall always satisfy mock_directive_dispatched

Witnesses· 1 scenario total

  • test_valid_keys_resolved_once_and_stable
    exercises 1 condition scenario

MC/DC truth table· 2 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
#mock_directive_dispatchedResultProvesCovering test
1FFmock_directive_dispatchedExempted · defensive — every directive maps to exactly one outcome in the dispatch table; a directive that dispatches to nothing is unreachable in a correct build (reviewed: agent:claude-opus-4-8)
2TTmock_directive_dispatched

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.

  • Anthropic /v1/messages: Python -> RustMIR-002
    DiffersPython → Rust
    View in Mirrors

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
1
Tests
1
At-risk contracts
0

Files to re-check (1)

  • utils.pylitellm/llms/anthropic/experimental_pass_through/messages/utils.py

Tests to re-run (1)

  • test_request_optional_param_utils.pytests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_request_optional_param_utils.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