Skip to content

release: v2.2.0#170

Merged
TexasCoding merged 1 commit into
mainfrom
release/v2.2.0
May 20, 2026
Merged

release: v2.2.0#170
TexasCoding merged 1 commit into
mainfrom
release/v2.2.0

Conversation

@TexasCoding

Copy link
Copy Markdown
Owner

Cuts v2.2.0 — the response-side spec drift hardening stack (#157).

Version bumps

  • pyproject.toml: 2.1.0 → 2.2.0
  • kalshi/__init__.py: 2.1.0 → 2.2.0

Semver: minor

All changes since v2.1.0 are additive or relaxing:

  • 65 new optional fields on response models (no breaks to existing field shapes).
  • le=32 constraint dropped on 6 subaccount request fields (only callers passing > 32 were affected, and those round-tripped to the server anyway).
  • WS envelope/helper models gained extra="allow" (relaxes tolerance, never tightens).
  • Test-infra warn→fail flip is internal-only — SDK users see no behavior change.

No API breaks. No migration required.

Release scope

Area Change
REST response models +38 fields across 13 models (Market, Order, Fill, Event, EventMetadata, Settlement, Trade, IncentiveProgram, RFQ, Quote, OrderGroup, GetOrderGroupResponse, CreateOrderGroupResponse)
WS payload models +33 fields across 11 payloads (Unix-ms *_ts_ms timestamps, outcome_side/book_side direction encoding, MVE linkage, RFQ/Quote context echoes)
Drift detection Additive drift now hard-fails CI; unmapped WS models hard-fail; required-but-optional stays warn-only (~204 entries, separate policy decision)
WS infrastructure ErrorPayload registered in WS_CONTRACT_MAP; envelopes + helpers all use extra="allow"
Bugfix Dropped le=32 cap on 6 subaccount request fields (demo allocates above 32; spec has no upper bound)

PRs in this release: #165 (PR0), #166 (PR1), #167 (PR2), #168 (PR3+4+5), #169 (#164 fix).

Docs touched

Verification

$ uv run python -c "import kalshi; print(kalshi.__version__)"
2.2.0

$ uv run pytest tests/ --ignore=tests/integration -q
2023 passed, 35 warnings in 127.76s

$ uv run pytest tests/integration/test_subaccounts.py::TestSubaccountsSync::test_transfer_between_subaccounts
1 passed in 2.30s          # against live demo, confirms #164 fix end-to-end

$ uv run mypy kalshi/
Success: no issues found in 76 source files

$ uv run ruff check .
All checks passed!

The 35 warnings are all test_required_drift / test_ws_required_drift — the required-but-optional axis stays warn-only per the issue stack's explicit out-of-scope note.

Release workflow

Once squash-merged, push tag v2.2.0 to trigger .github/workflows/release.yml:

  1. Verify tag matches pyproject.toml version (gate).
  2. Build sdist + wheel via uv build.
  3. twine check the artifacts.
  4. Publish to PyPI via trusted publishing (OIDC + sigstore attestations).
  5. Create GitHub release with the ## 2.2.0 — ... CHANGELOG section as notes.

No manual PyPI upload needed.

Cuts v2.2.0 — the response-side spec drift hardening stack (#157).

Version bumps:
- pyproject.toml: 2.1.0 → 2.2.0
- kalshi/__init__.py: 2.1.0 → 2.2.0

Docs:
- CHANGELOG.md: finalize ## Unreleased → ## 2.2.0 — 2026-05-19 with a
  release-summary headline. The Added/Changed/Fixed entries written
  incrementally across #166#169 stay as-is.
- ROADMAP.md: add v2.2.0 to Shipped with a coverage summary; drop the
  two "Next milestone" items now done by this release (response-side
  drift detection; WS envelope extra=allow); add two new follow-ups
  (map remaining REST sub-models into CONTRACT_MAP; required-but-
  optional drift policy decision).
- CLAUDE.md: active milestone → post-v2.2.

Release scope (65 new optional fields + warn→fail flip + 1 bugfix):
- REST response models: Market +11, Order +8, Fill +4, Event +3,
  EventMetadata +2, Settlement +1, Trade +2, IncentiveProgram +1,
  RFQ +1, Quote +3, OrderGroup +1, GetOrderGroupResponse +1,
  CreateOrderGroupResponse +2 (#166, #167, #168).
- WS payload models: 33 fields across 11 payloads — Unix-ms timestamps
  (`*_ts_ms`), outcome_side/book_side direction encoding, MVE linkage,
  RFQ/Quote context echoes (#168).
- Test infrastructure: additive drift now hard-fails CI; unmapped WS
  models hard-fail; required-but-optional stays warn-only (~204
  entries, separate policy decision). EXCLUSIONS allowlist wired
  through response-side checks (#165). ErrorPayload registered in
  WS_CONTRACT_MAP; WS envelopes/helpers all use extra=allow (#168).
- Bugfix: dropped le=32 cap on 6 subaccount request fields; demo
  allocates ephemeral subaccount numbers above 32 (observed 41 in
  nightly, 44 locally). Spec defines no upper bound (#169).

No API breaks. All changes additive or relaxing. Bump is semver-minor.

Verification:
- uv run pytest tests/ --ignore=tests/integration -q
    -> 2023 passed, 35 warnings (all required-drift, kept warn-only)
- uv run pytest tests/integration/test_subaccounts.py::TestSubaccountsSync::test_transfer_between_subaccounts
    -> 1 passed against live demo (#164 unblocked end-to-end)
- uv run mypy kalshi/      -> Success: no issues found in 76 source files
- uv run ruff check .      -> All checks passed!
- kalshi.__version__ check -> 2.2.0

After merge, push tag v2.2.0 to trigger the release workflow
(.github/workflows/release.yml): build sdist+wheel → PyPI trusted-
publish → GitHub release with CHANGELOG section as notes.
@claude

claude Bot commented May 20, 2026

Copy link
Copy Markdown

Code Review — v2.2.0 Release Cut

This is a clean, minimal release PR. The five changed files are all docs and version bumps; the actual code shipped in #165#169. Review notes below are ordered by importance.


Correctness

Field-count discrepancy in the PR body (informational)

The PR body's summary table says +38 fields across 13 models (REST) + +33 fields across 11 payloads (WS) = 71 fields / 24 models, but the CHANGELOG and ROADMAP both land on "65 new optional fields across 16 models". The discrepancy is only in the release-notes prose, not in the code, so there is no functional impact — but one of the two counts is wrong. If the CHANGELOG/ROADMAP figure of 65/16 is canonical (it appears to be, since it was written more carefully as the release was assembled), the table numbers in the PR description should have been reconciled before merge. Worth a quick pass before this PR is used as source material for the GitHub release notes.

CHANGELOG date vs. merge date

The changelog is stamped 2026-05-19 but today is 2026-05-20. If merge happens today the date will be one day off. Minor, but release notes are permanent — consider updating to match the actual merge date.


Version bumps

Both pyproject.toml and kalshi/__init__.py are bumped from 2.1.02.2.0. They are consistent with each other and with the PR title. ✓


Semver claim

Claimed as minor. The PR body enumerates: new optional fields (additive), relaxed le=32 constraint (broadening), extra="allow" on WS models (relaxing), test-infra warn→fail flip (internal). All of these are either additive or relaxing — none are API breaks. The minor bump is correct. ✓


Documentation changes

CHANGELOG.md — Upgrading ## Unreleased to ## 2.2.0 — 2026-05-19 is the right pattern. The summary paragraph is clearer and more complete than the pre-PR stub. ✓

ROADMAP.md — The shipped v2.2.0 entry is well-summarised. Removing the two completed "Next milestone" items and promoting new follow-ups (REST sub-model mapping pass, required-but-optional drift policy) keeps the backlog honest. The reformatting of deferred items with bold labels improves scannability. ✓

CLAUDE.md — Milestone updated from post-v2.0 to post-v2.2. ✓


Release workflow

The post-merge tag instruction (push tag v2.2.0 to trigger release.yml) is correct. The CI gate that verifies the tag matches pyproject.toml provides a safety net against mismatched publishes. ✓


Summary

The PR is release-ready modulo two low-severity documentation notes:

  1. Reconcile the 65/71 field-count discrepancy before the GitHub release notes are auto-generated from this PR.
  2. Update the CHANGELOG date to 2026-05-20 if merging today, or merge it today and leave it — pick one and be consistent.

No code changes to review; logic shipped in #165#169.

@TexasCoding
TexasCoding merged commit 2319fee into main May 20, 2026
5 checks passed
@TexasCoding
TexasCoding deleted the release/v2.2.0 branch May 20, 2026 00:08
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