Proof Portal
litellm
BerriAI117 findings · 107 requirementsLiteLLM Python->Rust migration audit (proof mirroring).
93 withheld (location undisclosed)
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
Specification
The requirement exactly as authored — its complete prose text and, where present, the formal FRETish sentence it compiles to.
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
the anthropic_messages shall always satisfy mock_directive_dispatched
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
- 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
- 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.
- 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 catalogueHappy-path behavior with valid inputs.
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.
- nominalrequiredpresentCovered by 2 tests
Behavior when operations fail or dependencies are unavailable.
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.
- 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
the anthropic_messages shall always satisfy mock_directive_dispatched
Witnesses· 1 scenario total
- test_valid_keys_resolved_once_and_stableexercises 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.
mcdc:ignoreNo-actionfalse-result row satisfied by designUncoveredneeds a covering test| # | mock_directive_dispatched | Result | Proves | Covering test |
|---|---|---|---|---|
| 1 | F | F | mock_directive_dispatched | Exempted · 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) |
| 2 | T | T | mock_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.
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-002DiffersPython → 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 (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.