Skip to content

fix: harden v4 live-order paths and sync docs for 4.0.1 - #110

Merged
TexasCoding merged 2 commits into
mainfrom
fix/v4-hardening
Aug 30, 2026
Merged

fix: harden v4 live-order paths and sync docs for 4.0.1#110
TexasCoding merged 2 commits into
mainfrom
fix/v4-hardening

Conversation

@TexasCoding

Copy link
Copy Markdown
Owner

Summary

Post-v4.0.0 hardening so the SDK is safer for live orders and the docs match 4.0.1.

  • Live-order safety: mutating POSTs (/Order/place|cancel|modify, position close) are not retried. Timeout, disconnect, 5xx, or cancel after send raises OrderSubmissionUncertainError.
  • Realtime: stale-feed reconnect restores user and market subscriptions. Hub task names no longer include JWTs.
  • Brackets: native Gateway brackets fall back to client-side protection unless stop/target children can be uniquely resolved.
  • Reconciliation: stale-order recovery uses POST /Order/search. Fill checks report partial fills when original size is known.
  • API robustness: Account.from_api() / Instrument.from_api(), filledSizefillVolume, failed position/trade searches raise instead of returning [].
  • Guards: max_order_size when validation is on, reject remote http:// URLs, apply requests_per_minute to the limiter, disable HTTP redirects.
  • Docs/CI: README and user-facing docs updated off 3.5.x. release.yml is GitHub Release only; PyPI stays on publish-pypi.yml. Hatch uses dynamic version from __init__.py.

Plan: docs/superpowers/plans/2026-08-29-v4-hardening.md

Test plan

  • pytest on HTTP, orders, brackets, tracking, realtime health, models, config, auth (297 passed)
  • ruff + mypy on touched modules
  • pre-commit hooks on this commit
  • CI on this PR
  • Spot-check that a mocked 503 on POST /Order/place is one attempt and OrderSubmissionUncertainError

Stop retrying mutating broker POSTs and raise OrderSubmissionUncertainError
on timeout, disconnect, 5xx, or cancel after send. Restore SignalR
subscriptions after stale-feed reconnect, and fall back from native
brackets when child orders cannot be uniquely resolved.

Also fix POST /Order/search recovery, partial fill reporting, tolerant
Account/Instrument constructors, max_order_size enforcement, JWT-free hub
task names, HTTPS URL validation, and align README/docs/CI with 4.0.1.
@claude

claude Bot commented Aug 30, 2026

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

CI failed because setup tests still asserted the pre-v4 with_url(url)
signature. pysignalr hubs are now named "user" and "market".
@claude

claude Bot commented Aug 30, 2026

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@TexasCoding
TexasCoding merged commit 8bd1a79 into main Aug 30, 2026
8 of 9 checks passed
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