Skip to content

fix: reconcile spec drift #556 #557 (22.4.0) - #558

Merged
TexasCoding merged 1 commit into
mainfrom
fix/556-557-spec-drift
Oct 26, 2026
Merged

TexasCoding merged 1 commit into
mainfrom
fix/556-557-spec-drift

Conversation

@TexasCoding

Copy link
Copy Markdown
Owner

Reconciles nightly spec drift (Spec Drift run 40320006492). Release 22.4.0 (minor).

Closes #556
Closes #557

Changes

  • scripts/sync_spec.py + scripts/generate.py (re-vendored specs/openapi.yaml, specs/asyncapi.yaml, specs/perps_openapi.yaml; no hand edits in kalshi/_generated).
  • CreateRFQBatchChild: optional contracts (contracts_fp, FixedPointCount) and target_cost (target_cost_dollars, DollarDecimal) with serialization_alias + AliasChoices, matching CreateRFQBatchRequest.
  • Perps MarginMarket.halt_sources: list[str] | None = None. Spec marks it required; kept optional (PERPS_EXCLUSIONS entry, kind server_omits_despite_required) so this stays non-breaking.
  • AsyncAPI 16 → 15 channels: core batch_communications removed; RFQ-batch messages now arrive on communications. The SDK never exposed a helper/model for it, so nothing was removed; notes added on subscribe_communications(), CommunicationsMessage, docs/websockets.md.
  • Regression tests, docs, CHANGELOG, version 22.4.0.

Blast radius (manual; GitNexus unavailable)

  • CreateRFQBatchChild: new optional fields default None and are excluded when unset → existing rfq_batches.create() payloads serialize identically. Used only by communications.rfq_batches.create (sync + async).
  • MarginMarket: new optional field; existing constructors/fixtures and payloads without it still validate. Consumers: perps markets.list/get and anything embedding MarginMarket.
  • WS: docstring-only changes; no routing/model change.
  • Contract map / test exclusions: one new perps exclusion.

Gates

  • uv run ruff check . ✅
  • uv run mypy kalshi/ ✅
  • uv run pytest tests/ --ignore=tests/integration -q ✅ 4935 passed, 3 skipped
  • uv run pytest tests/test_contracts.py -W error::UserWarning ✅ 902 passed

@TexasCoding
TexasCoding merged commit 2d678c3 into main Oct 26, 2026
6 checks passed
@TexasCoding
TexasCoding deleted the fix/556-557-spec-drift branch November 1, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant