docs: overhaul mkdocs site with full SDK coverage#153
Conversation
Audit-driven rewrite of the documentation. Adds dedicated pages for every resource (19), the WebSocket module, request models, types, pagination, DataFrames, configuration, retries/idempotency, testing helpers, and a concepts glossary. Fixes inaccuracies in existing pages: - errors.md: backoff formula was additive jitter; corrected to AWS Full Jitter to match _base_client.py. - websockets.md: wire type names (singular market_position/user_order, multivariate_lookup), callback fan-out semantics (not takeover), backpressure behavior (fatal teardown, not log-and-continue). - resources/index.md: removed fictitious 1000-page list_all cap; corrected the "market data needs no auth" claim for orderbook/bulk_orderbooks. - authentication.md: distinguished preflight AuthRequiredError from server 401/403 KalshiAuthError; documented from_pem, PKCS8/RSA constraints, and passphrase-key remediation. mkdocs.yml: restructured nav into Getting Started / Core / Resources / WebSocket / Testing / Migration / Reference; tightened mkdocstrings options; added not_in_nav for internal worklog pages. Builds clean under --strict. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review — PR #153: docs: overhaul mkdocs site with full SDK coverageThis is a well-executed documentation overhaul. The inaccuracy fixes are correct and material — the old backoff description, WebSocket routing claim, backpressure fatality, and the phantom 1000-page cap were genuinely misleading. The new per-resource pages are consistently structured and the cross-linking is good. A few things worth addressing before merge. Potential inaccuracy — retries.md PUT/PATCH treatment The new table says POST, DELETE, PUT, PATCH are never retried, but CLAUDE.md documents only POST and DELETE as never-retried ("duplicate order/cancel risk"). PUT and PATCH aren't mentioned there. Please verify _base_client.py — if PUT is treated the same as GET in the retry logic, this table is wrong and could surprise users who expect PUT (e.g. order_groups.reset(), subaccounts.update_netting()) to retry on 5xx. Factual issue — reconciliation example filters on status="resting" In retries.md under 'Reconciliation after a 5xx on a write', the example scans client.orders.list_all(status="resting"). An order that landed before the 5xx may be executed or canceled by the time you check, not resting. Filtering to only resting orders means you'd retry a fill that already happened. Drop the status= filter and add a note that executed is also a valid terminal state here. Missing per-channel overflow/behavior reference in websockets.md The old doc had per-channel sections (subscribe_ticker, subscribe_orderbook_delta, etc.) documenting overflow strategy, unique params (shard_factor/shard_key for subscribe_communications), and firehose behavior. The new backpressure table covers overflow, but a reader of subscribe_communications() won't know that shard_factor/shard_key exist — they're buried in the generic subscribe() section. Consider adding a 'Notable params' column to the 11-channel table. Unchecked test plan items Two of three test plan items are still open — the 'from kalshi import' path check is especially worth doing before merge. The new pages use 'from kalshi import TickerPair', 'from kalshi import CreateOrderRequest', etc. A quick python -c 'from kalshi import TickerPair' confirms they're reachable from the public surface. Minor nits
What is well done
The PUT/PATCH retry claim and the reconciliation example are the two items to confirm before merge. |
Summary
Audit-driven rewrite of the docs site. Nine research agents compared each SDK subsystem against the existing docs in parallel; this PR fixes everything they flagged and fills in the gaps.
mkdocs build --strict.Inaccuracies fixed
errors.mddocumented the backoff as additive jitter — actual code is AWS Full Jitter (_base_client.py:86-87).websockets.mdlisted the wrong wiretypevalues (singularmarket_position/user_order/multivariate_lookup); claimed callbacks "take over routing" — they actually fan out alongside iterators; claimed backpressure errors are recoverable — they are fatal teardown of the recv loop.resources/index.mdclaimed a non-existent 1000-page cap inlist_all()and that all market data is auth-free (false fororderbook/bulk_orderbooks/series.forecast_percentile_history/exchange.user_data_timestamp).authentication.mdconflated preflightAuthRequiredErrorwith server 401/403KalshiAuthError; missedfrom_pem, PKCS#8 / RSA constraints, and passphrase-key remediation.Other notes
kalshi/cli/was investigated and intentionally not documented — no.pysources are tracked, only stale__pycache__.mkdocs.yml: tightened mkdocstrings options, addednot_in_navfor internal worklog pages (AUDIT-resource-params.md,RELEASING.md).Test plan
uv run mkdocs build --strictsucceeds cleanly.uv run mkdocs serveand verify the autodoc blocks render for each resource.from kalshi importpaths that don't exist.🤖 Generated with Claude Code