Proof Portal
litellm
BerriAI117 findings · 107 requirementsLiteLLM Python->Rust migration audit (proof mirroring).
93 withheld (location undisclosed)
the AnthropicMessagesRequestOptionalParams key allowlist is resolved from the TypedDict hints exactly once per process (lru_cache) and every call returns the same stable frozenset identity
Specification
The requirement exactly as authored — its complete prose text and, where present, the formal FRETish sentence it compiles to.
the AnthropicMessagesRequestOptionalParams key allowlist is resolved from the TypedDict hints exactly once per process (lru_cache) and every call returns the same stable frozenset identity
the anthropic_messages shall always satisfy allowlist_keys_resolved_once_stable
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
- scenarioreviewednominal
nominal is the resolved-allowlist happy path (the frozenset contains the expected keys and drives the filter); there is no malformed/empty partition for a static hint resolution
- propertyreviewedpure_function_property_testeddeterminism
The lru_cache-memoized allowlist is a pure nullary function; single-resolution (cache misses==1) and stable frozenset identity across calls are its determinism/purity properties
- structuralnot applicable
Garbage-collected Python returning an immutable frozenset; no manual memory, pointer arithmetic, overflow, or format string
- domainnot applicable
Pure in-process TypedDict-hint resolution with no network/filesystem/IPC call
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-13
_anthropic_messages_optional_param_keys line 11 is decorated @lru_cache(maxsize=1) and returns frozenset(get_type_hints(...).keys()); the static TypedDict hints are resolved exactly once per process and the same frozenset identity is returned on every call. Matches the allowlist_keys_resolved_once_stable guarantee.
Cited code (2)
Obligations
What this requirement must witness to be considered satisfied — the required evidence, and the tests that discharge each one.
3 obligations · 3 discharged
Browse the catalogueHappy-path behavior with valid inputs.
If the allowlist resolved to the wrong or an empty key set, every /v1/messages request would silently strip all optional params when empty, or forward unsupported ones when over-broad, corrupting every downstream request.
- nominalrequiredpresentCovered by 1 test
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.
If the memoized resolver were impure it could observe different TypedDict hints across calls, so its single-resolution and stable-identity properties would not be property-testable.
- nominalrequiredpresentCovered by 1 test
Output identical regardless of collection ordering or runtime conditions.
If the lru_cache memoization were defeated and the frozenset recomputed per call, the fixed get_type_hints cost would return to the per-request hot path, regressing /v1/messages parse latency.
- 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 allowlist_keys_resolved_once_stable
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| # | allowlist_keys_resolved_once_stable | Result | Proves | Covering test |
|---|---|---|---|---|
| 1 | F | F | allowlist_keys_resolved_once_stable | Exempted · defensive — the lru_cache resolves the static TypedDict hints exactly once and returns the same frozenset identity forever; an unstable/recomputed allowlist is unreachable in a correct build (reviewed: agent:claude-opus-4-8) |
| 2 | T | T | allowlist_keys_resolved_once_stable |
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.