contracts: pin the CLI contract from InferenceInfra's code-complete line (draft, do not merge yet)

Draft
SA
3d ago
+301-13

What this is

InferenceInfra's new_infra -> staging promotion runs consumer-impact, which compares this repo's main pin of the control-plane contract with the document at the promotion head. Against Wally main today it reports two stale pins (probe run 39821135687):

PinWally mainSource head
contracts/wally-cli-v1.openapi.json (CLI slice digest)874aaee1b08bfa883210af07
contracts/wally-decisions-public-v1.openapi.jsonc58df52d97cd592f19f7d594

The same check is already red against InferenceInfra staging itself (874aaee1b08b -> ef52e0dcf18f): Wally's pin was cut from the live line (fix/codex-harness-live, 3fb1fd00).

Two commits

  1. contracts: carve GET /v1/models down to the default form the CLI reads: extract-cli-contract.py leaves the format query out of listModels and reads ModelListResponse as ModelList. Needed because InferenceInfra's track/api-parity makes the models list answer a second form (?format=openrouter-v2) as a oneOf with no discriminator; the CLI never sends format. Without this, the binding generator stops with unsupported schema shape at OpenRouterV2ParameterDescriptor.properties. Three new tests in tests/test_contract_sync.py (red before the change). No pin moves in this commit.
  2. contracts: pin the CLI contract from InferenceInfra's code-complete line (a8259392): output of python3 contracts/sync_from_inferenceinfra.py --from <InferenceInfra @ a8259392>. Additive only: 34 new ApiErrorCode values, x-request-id on the models response, anonymous-capable GET /v1/models, description wording. console_contract.rs is regenerated; the only use of the enum outside it is == ApiErrorCode::KCardRequired.

The decisions pin is deliberately not touched

Wally main already carries the Eve prompt_format_version 4 revision (ecd738b2, sha256 2201716c...). track/api-parity brings the same bytes to InferenceInfra's integration branch; new_infra is the one that lacks them today. So that red clears when track/api-parity merges, and re-vendoring the older document here would drop format 4 from what production accepts.

Checked

  • python3 tests/test_contract_sync.py: 8 tests OK
  • python3 contracts/generate_console_binding.py --check: both bindings match their pins
  • python3 contracts/sync_from_inferenceinfra.py --check: Wally CLI lock OK (a8259392, track/api-parity)
  • console_contract.rs compiles standalone (cargo check, serde_json only)
  • InferenceInfra's gate, python3 contracts/check_consumer_impact.py --against-wally-pin --head <track/api-parity checkout> --wally-repo <this branch>: consumer-impact: none
  • Not run: a full cargo check of wally (build.rs needs the CMake kit); CI compiles it.

DRAFT: do not merge yet

  • Merge only when the InferenceInfra owner says so. This pin gets ahead of what production serves today.
  • Ready condition: InferenceInfra integration/code-complete contains track/api-parity. Then re-run the gate against the integration head; if its control-plane document changed since a8259392, re-run the sync (the slice digest, not the stamp, is what is compared).
  • Merge order: this PR first, then the InferenceInfra promotion PR (list this URL under "Required downstream PRs").

šŸ¤– Generated with Claude Code


Summary by cubic

Re-syncs the CLI contract pin to InferenceInfra's track/api-parity line (a8259392), which is what its new_infra → staging promotion compares against; the current pin (from the live line) is stale against both Wally main and InferenceInfra staging. The decisions contract is deliberately not touched: Wally main already carries the format 4 revision the new line serves.

Changes

  • extract-cli-contract.py now carves GET /v1/models down to the default ModelList form the CLI reads, dropping the format query and the openrouter-v2 oneOf branch; the binding generator cannot read that shape, and a change to it must not flag the pin stale. Older sources without the query are carried unchanged.
  • The slice adds 34 ApiErrorCode values, anonymous GET /v1/models, the x-request-id response header, and updated description wording. console_contract.rs is regenerated; its only external use is == ApiErrorCode::KCardRequired.

Merge note

Do not merge yet: this pin gets ahead of what production serves. Merge only after InferenceInfra's owner confirms, once integration/code-complete contains track/api-parity; re-run the sync if the control-plane document changed since a8259392. This PR lands before the promotion PR.