Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

All notable changes to kalshi-sdk will be documented in this file.

## Unreleased
## 2.2.0 — 2026-05-19

Response-side spec drift hardening stack (#157). Backfills the remaining
v3.18.0 / v0.14 fields and promotes additive drift to a hard CI failure.
v3.18.0 OpenAPI / v0.14 AsyncAPI fields across REST and WebSocket response
models (65 new optional fields across 16 models), promotes additive
drift from warning to hard CI failure, and lands a high-signal bugfix
for the subaccount-number request constraint that was rejecting valid
server-assigned values.

### Added

Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ All work — bugs, enhancements, polish, spec drift — is tracked in **GitHub I
on `TexasCoding/kalshi-python-sdk`. Use the `gh` CLI or the GitHub UI; do not add
markdown trackers (TODOS/BACKLOG) back to the repo.

- Active milestone: post-v2.0 (after the audit-driven hardening wave that shipped v2.0.0)
- Active milestone: post-v2.2 (after the response-side spec drift hardening stack that shipped v2.2.0)
- Labels in use: `bug`, `enhancement`, `documentation`, `polish`, `breaking`, `spec-drift`, `testing`, `infra`, `ws`, `cli`
- `ROADMAP.md` — short pointer to the active milestone
- `CHANGELOG.md` — release-facing history; updated per release
Expand Down
39 changes: 26 additions & 13 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@

See `CHANGELOG.md` for full release history.

- **v2.2.0 (2026-05-19)** — response-side spec drift hardening (`#157`).
65 new optional fields backfilled across 16 REST + WS response models
for OpenAPI v3.18.0 / AsyncAPI v0.14 (`Market`, `Order`, `Fill`,
`Event`, `EventMetadata`, `Settlement`, `Trade`, `IncentiveProgram`,
`RFQ`, `Quote`, `OrderGroup` + 3 group responses, plus 11 WS payloads
including the new `*_ts_ms` Unix-ms timestamps and
`outcome_side` / `book_side` direction encoding). Promoted additive
drift from warn → hard fail in CI so the next missed field surfaces
loudly. Relaxed the request-side `le=32` cap on six subaccount fields
(demo allocates above 32). Registered `ErrorPayload` in
`WS_CONTRACT_MAP`; applied `extra="allow"` to all WS envelope and
helper classes to match the payload policy from `#143`.
- **v2.1.0 (2026-05-18)** — OpenAPI sync v3.13.0 → v3.18.0 (`#155`). V2
event-market orders family (`create_v2` / `amend_v2` / `decrease_v2` /
`cancel_v2` + batched variants on `/portfolio/events/orders/*`),
Expand Down Expand Up @@ -47,20 +59,21 @@ See `CHANGELOG.md` for full release history.

Not scoped. Carry-overs from v2.1 and v2.0 audit backlog:

- **Response-side spec drift detection.** v2.1 contract tests cover request
bodies (`TestRequestBodyDrift`) but not response models, which is how
`Balance.balance_dollars` slipped through 5 rounds of review. Add a
`RESPONSE_MODEL_MAP` + walker that asserts spec-required fields exist on
the SDK model.

- Apply `extra="allow"` policy to WS envelope models (`kalshi/ws/models/`)
to mirror the response-model uniformity from `#114`.
- `MessageQueue._buffer = collections.deque(maxlen=maxsize+1)` for
- **`MessageQueue._buffer = collections.deque(maxlen=maxsize+1)`** for
defense-in-depth (#106 F-P-15 / F-R-02).
- `_to_decimal_dollars` / `_to_decimal_fp` consolidation (#106 F-N-09 +
the follow-up noted in #140).
- WS UX foot-guns: auto-start recv loop when no `subscribe_*` was called,
resubscribe-time data-frame stashing (#106 F-P-16 / F-R-13).
- **`_to_decimal_dollars` / `_to_decimal_fp` consolidation** (#106
F-N-09 + the follow-up noted in #140).
- **WS UX foot-guns**: auto-start recv loop when no `subscribe_*` was
called, resubscribe-time data-frame stashing (#106 F-P-16 / F-R-13).
- **Map remaining REST sub-models / V2 family / internal containers**
(~42 entries) into `CONTRACT_MAP` and promote
`test_contract_map_completeness` (REST) to hard-fail. WS side already
hard-fails as of v2.2.0; the REST side stays warn-only until the
mapping work lands.
- **Required-but-Optional drift policy decision** (~204 entries on
`test_required_drift` / `test_ws_required_drift`). Currently warn-only;
promote to fail behind either an allowlist or a tightening pass that
drops `None` defaults on fields the server reliably sends.

Pick from `gh issue list` and the deferred items in `#106` opportunistically.

Expand Down
2 changes: 1 addition & 1 deletion kalshi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,4 @@
"Withdrawal",
]

__version__ = "2.1.0"
__version__ = "2.2.0"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "kalshi-sdk"
version = "2.1.0"
version = "2.2.0"
description = "A professional Python SDK for the Kalshi prediction markets API"
readme = "README.md"
license = { text = "MIT" }
Expand Down
Loading