Skip to content

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

Draft
sanchitmonga22 wants to merge 2 commits into
mainfrom
contracts/sync-inferenceinfra-code-complete
Draft

sanchitmonga22 wants to merge 2 commits into
mainfrom
contracts/sync-inferenceinfra-code-complete

Conversation

@sanchitmonga22

@sanchitmonga22 sanchitmonga22 commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

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):

Pin Wally main Source head
contracts/wally-cli-v1.openapi.json (CLI slice digest) 874aaee1b08b fa883210af07
contracts/wally-decisions-public-v1.openapi.json c58df52d97cd 592f19f7d594

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.

Written for commit 34d54f6. Summary will update on new commits.

View guided diff Turn on auto-fix

sanchitmonga22 and others added 2 commits October 22, 2026 14:27
InferenceInfra's models list is about to answer a second form, `?format=openrouter-v2`: the
operation gains a `format` query parameter and its 200 becomes `ModelListResponse`, a `oneOf`
of `ModelList` and `OpenRouterModelDocumentList` with no discriminator (the query picks the
variant). The CLI sends no `format`, so it only ever reads `ModelList`.

Left in the slice, the second form stops the binding generator ("unsupported schema shape" at
OpenRouterV2ParameterDescriptor.properties: an inline object that refers to itself), and any
later change to that form would mark the CLI's pin stale for something it never reads.

extract-cli-contract.py now leaves the `format` parameter out of listModels and reads
`ModelListResponse` as `ModelList` (CLI_NARROWED_OPERATIONS). A source contract without them is
carried unchanged, so this commit alone moves no pin: wally-cli-v1.openapi.json is byte-identical.

tests/test_contract_sync.py gains three cases, red before the change: the slice keeps only the
default form; a change to the other form does not move the slice; an older source is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ine (a8259392)

Wally main's pin is the live line's (3fb1fd00, `fix/codex-harness-live`). InferenceInfra's `new_infra` ->
`staging` promotion compares this repo's main pin to the control-plane document at its head
("downstream contract freshness / Wally main vs this control-plane") and stays red until this
pin matches. This re-syncs it with `contracts/sync_from_inferenceinfra.py --from <checkout>`.

Source: InferenceInfra track/api-parity a8259392, which is `integration/code-complete`
(c76e9697) plus the catalogue and public models-list change. Its control-plane-v1 document is
byte-identical to the merge of that track into the integration branch, which is the document
that will be promoted.

What moves in the CLI slice (additive; nothing the CLI reads is removed):
- ApiErrorCode gains 34 values the staging line added (organisations, invitations, partners,
  operator, price-book errors).
- `GET /v1/models` is anonymous-capable (`security: [BearerAuth, {}]`), declares the
  `x-request-id` response header, and has new summary/description text.
- Wording of the reasoning, datacenter and whoami descriptions follows the source.
- The `format=openrouter-v2` form of the models list is NOT in the slice (previous commit).

console_contract.rs is regenerated (CONTRACT_SHA256 moves). The only use of the error enum
outside it is `== ApiErrorCode::KCardRequired` in console.rs, so no match needs new arms. The
decisions contract is not touched: Wally main already carries the Eve format 4 revision
(ecd738b2), which is byte-identical to the one in track/api-parity.

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)
- the regenerated console_contract.rs compiles on its own (cargo check, serde_json only)
- InferenceInfra's own gate, `check_consumer_impact.py --against-wally-pin`, run on a
  track/api-parity checkout against this tree: "consumer-impact: none" (CLI slice and decisions).
A full `cargo check` of wally could not run here (build.rs needs the CMake kit); CI compiles it.

Merge order: this lands before InferenceInfra's promotion PR (its consumer-impact gate reads
this repo's main). If the control-plane contract moves again before then, re-run the sync.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant