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

_enforce_min_max_output_tokens raises max_output_tokens to the OpenAI Responses API minimum of 16 if and only if it is an int strictly below 16; None and values at or above 16 pass through unchanged

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

Specification

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

Description

_enforce_min_max_output_tokens raises max_output_tokens to the OpenAI Responses API minimum of 16 if and only if it is an int strictly below 16; None and values at or above 16 pass through unchanged

FRETish formula
the openai_responses shall always satisfy (max_output_tokens_floored <-> (max_output_tokens_is_int & max_output_tokens_below_min))
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 31, 2026, 00:00 UTC · Claude Code · AI agent
Modified
Jul 31, 2026, 00:00 UTC · Claude Code · AI agent

Hazard review

Reviewed Jul 31, 2026, 00:00 UTCby agent:claude-codecatalog v1.9.0
  • scenarioreviewednominalboundary

    nominal keeps None and at/above-min values unchanged; boundary is the numeric threshold partition around 16 (below_min raised, at_min and above_min unchanged) enumerated in the max_output_tokens_floor table. empty_input is folded into the None class which is the nominal passthrough, not a distinct partition

  • propertyreviewedpure_function_property_tested

    _enforce_min_max_output_tokens is a pure numeric clamp (output=f(tokens), no I/O), so the floor biconditional is property-testable; determinism follows from purity and monotonicity has no accumulation referent for a single-value clamp

  • structuralnot applicable

    Python arbitrary-precision int comparison with no fixed-width overflow, manual memory, pointer arithmetic, or format string

  • domainnot applicable

    Pure in-process numeric clamp issuing 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.

  1. Claude Code · AI agentApprovedSpec conformanceJul 31, 2026 · 4 months agoREVIEW-15

    _enforce_min_max_output_tokens: line 73 'if isinstance(max_output_tokens, int) and max_output_tokens < 16: return 16' floors sub-min ints; None and >=16 fall through unchanged. FRETish max_output_tokens_floored <-> (max_output_tokens_is_int & max_output_tokens_below_min) matches the isinstance-int AND below-16 conjunction (boundary at 16).

    Cited code (1)

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.

3 obligations · 3 discharged

Browse the catalogue
Discharged

Happy-path behavior with valid inputs.

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

Behavior at limits, thresholds, and edge-of-range values.

Discharging evidence1/1 required witnessed
  • 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 1 test

Code signals

Static-analysis signals from external scanners that bear on this requirement's obligations — the source location, the obligation each touches, and its closure status.

  • Missingbuiltinunordered_set_to_output
    Obligation: Determinism · Property

    Output identical regardless of collection ordering or runtime conditions.

    OpenAIResponsesAPIConfig.get_supported_openai_params: list(set(...)) — no total order

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 openai_responses shall always satisfy (max_output_tokens_floored <-> (max_output_tokens_is_int & max_output_tokens_below_min))

Witnesses· 2 scenarios total

  • test_floor_boundary_partitions
    exercises 2 condition scenarios

MC/DC truth table· 5 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
#max_output_tokens_below_minmax_output_tokens_flooredmax_output_tokens_is_intResultProvesCovering test
1FFFTmax_output_tokens_floored
2FTFFmax_output_tokens_flooredExempted · defensive — None is returned unchanged (never floored), so a floored non-int is unreachable in a correct build (reviewed: agent:claude-opus-4-8)
3FTTFmax_output_tokens_below_minExempted · defensive — an int at/above the minimum is returned unchanged, so flooring an at/above-min value is unreachable in a correct build (reviewed: agent:claude-opus-4-8)
4TTFFmax_output_tokens_is_intExempted · defensive — a sub-minimum value requires an int, so a floored non-int below the min is unreachable in a correct build (reviewed: agent:claude-opus-4-8)
5TTTTmax_output_tokens_below_min

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.

  • OpenAI Responses API: Python -> RustMIR-003
    Not portedPython → 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)

  • transformation.pylitellm/llms/openai/responses/transformation.py

Tests to re-run (1)

  • test_openai_responses_transformation.pytests/test_litellm/llms/openai/responses/test_openai_responses_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