Skip to content

feat(spec): FCM IM cap, DLP programs, cover market lifecycle — 22.19.0 (#594) - #596

Closed
TexasCoding wants to merge 4 commits into
mainfrom
fix/594-openapi-3.39.0
Closed

TexasCoding wants to merge 4 commits into
mainfrom
fix/594-openapi-3.39.0

Conversation

@TexasCoding

Copy link
Copy Markdown
Owner

Closes #594

Supersedes #595, which opened successfully but GitHub Actions never queued pull_request workflows (CI / Spec Drift) despite an active repo, a user OAuth token with the workflow scope, a close/reopen, and an empty retrigger commit. workflow_dispatch of Spec Drift Detection on the same SHA does run (https://github.com/TexasCoding/kalshi-python-sdk/actions/runs/46925634823). This PR is a fresh branch of the same commits to give the pull_request event another chance.

Reconciles the nightly spec-drift failure on main (OpenAPI 3.39.0; AsyncAPI, perps, and SCM specs also changed). Additive only — releases as 22.19.0 (minor). No breaking changes.

The failing run was https://github.com/TexasCoding/kalshi-python-sdk/actions/runs/46783195129 (TestWsSpecDrift::test_batch_communications_channel_removed and test_every_spec_endpoint_is_mapped[perps]; after the local spec sync, test_every_spec_endpoint_is_mapped[core] and SCM response drift on ObligationEntry / CorporateActionPaymentDetail also failed). Those tests now pass.

Spec changes → SDK

  • Perps FCM IM cap (sync + async): fcm.get_im_cap(), update_im_cap(*, im_cap=), delete_im_cap() — GET/PUT/DELETE /margin/fcm/im_cap. GetFCMIMCapResponse.im_cap and current_im are optional DollarDecimal (wire names im_cap / current_im, no _dollars suffix; both absent when unset or unavailable). PUT body is UpdateFCMIMCapRequest (extra="forbid"); returns no body. PUT/DELETE are never retried.
  • Core incentive_programs.dlp_programs() (sync + async) — GET /dlp_programs. Public. Returns GetDlpProgramsResponse with bidding_periods and incentivized_series (null/missing lists parse as []).
  • Core Settlement.value_dollars (DollarDecimal | None). value (integer cents) is deprecated and kept.
  • Klear optional ObligationEntry.obligation_type and optional CorporateActionPaymentDetail.withholding_fp / withholding_rate_bps / withholding_reason, with server_omits_despite_required exclusions so older payloads still parse.
  • WebSocket cover_market_lifecycle channel and subscribe_cover_market_lifecycle(). Payload CoverMarketLifecycleMessage (same msg shape as market_lifecycle_v2). market_lifecycle_v2 also carries milestone_updated (MilestoneUpdatedMessage: milestone_id, last_updated_ts_us, free-form milestone dict). AsyncAPI 16 → 17 channels; 14 typed subscribe_*.
  • Description-only wording (perps exchange_status snapshot note, SCM obligation/withholding docs, "on-request" → "cover") needed no code.

Blast radius (manual; GitNexus not installed)

  • All new response fields are optional; existing payloads parse unchanged.
  • Request model UpdateFCMIMCapRequest is new and extra="forbid"; no existing request body changes.
  • PUT/DELETE retry policy is unchanged (RETRYABLE_METHODS remains GET/HEAD/OPTIONS).
  • Existing market_lifecycle_v2 subscribers may now also receive typed milestone_updated messages through the SDK dispatcher (additive; previously this type was not in the spec).
  • Settlement.value is unchanged. value_dollars is a new optional field.
  • Public exports add the new FCM, DLP, and WS models next to their existing neighbors.

Gates

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

Add perps FCM account-level IM cap (GET/PUT/DELETE /margin/fcm/im_cap),
core GET /dlp_programs, Settlement.value_dollars, Klear obligation_type
and withholding fields, WebSocket cover_market_lifecycle plus
milestone_updated on market_lifecycle_v2. Additive only; PUT/DELETE
remain non-retried.
Minor bump for the additive OpenAPI 3.39.0 spec-drift work.
Workflows did not queue on the initial PR open or reopen.
TexasCoding added a commit that referenced this pull request Dec 2, 2026
pull_request events are not queuing CI or Spec Drift Detection
on this repo (confirmed on #595 and #596). workflow_dispatch still
works and is needed to land #594.
@TexasCoding

Copy link
Copy Markdown
Owner Author

Closing as duplicate of #595. Opened only to test whether a fresh pull_request event would queue Actions; it did not. The same commits remain on #595.

@TexasCoding TexasCoding closed this Dec 2, 2026
TexasCoding added a commit that referenced this pull request Dec 2, 2026
… 22.19.0 (#595)

* chore(specs): sync OpenAPI 3.39.0 / AsyncAPI / perps / SCM specs (2026-12-02) (#594)

* feat: reconcile OpenAPI 3.39.0 spec drift (#594)

Add perps FCM account-level IM cap (GET/PUT/DELETE /margin/fcm/im_cap),
core GET /dlp_programs, Settlement.value_dollars, Klear obligation_type
and withholding fields, WebSocket cover_market_lifecycle plus
milestone_updated on market_lifecycle_v2. Additive only; PUT/DELETE
remain non-retried.

* chore(release): 22.19.0 (#594)

Minor bump for the additive OpenAPI 3.39.0 spec-drift work.

* ci: retrigger Actions on #595

Workflows did not queue on the initial PR open or reopen.

* ci: allow workflow_dispatch so required checks can be run manually

pull_request events are not queuing CI or Spec Drift Detection
on this repo (confirmed on #595 and #596). workflow_dispatch still
works and is needed to land #594.
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.

Nightly spec-drift: strict contract tests failing (since 2026-12-02)

1 participant