Repository navigation
feat(sdk): add scenario evaluation and spot-target solving - #46
Draft
thestephenromano wants to merge 2 commits into
Draft
thestephenromano wants to merge 2 commits into
thestephenromano wants to merge 2 commits into
Conversation
2 of 4 tasks
thestephenromano
added a commit
that referenced
this pull request
Nov 5, 2026
The API's rate-card correction removes `units_charged` and `compute_schedule_version` from public responses. Requiring them makes otherwise valid pricing responses fail SDK validation. Accept both fields as optional, deprecated compatibility data for older deployments. Commercial evidence remains exclusively `fcu_quoted` / `fcu_charged`; there is no fallback conversion. Sync and async tests exercise the new response shape. The pinned deployed contract and historical fixtures remain unchanged for this compatibility preparation. Validation: 539 tests passed, 18 opt-in integration tests skipped; Ruff lint/format and mypy passed. GitHub CI passed on Python 3.11 and 3.14, including the Docker notebook check. Companion to [API #155](https://gitlab.com/prophetizo/morphiq-labs/sites/morphiq-api/-/issues/155) and [API MR !210](https://gitlab.com/prophetizo/morphiq-labs/sites/morphiq-api/-/merge_requests/210). Independent of solver PR #46. Draft: coordinate with the API rollout; do not merge/release as part of solver work.
Merged
thestephenromano
added a commit
that referenced
this pull request
Nov 5, 2026
Release Please generated this release from merged changes. Its unsigned commit was rejected by the signed-commit rule; the identical tree was signed locally and pushed without changing any generated version or changelog content. ## [0.2.0](v0.1.1...v0.2.0) (2026-11-05) ### ⚠ BREAKING CHANGES * **client:** align Python SDK with API v0.5.0 ([#41](#41)) ### Features * **client:** align Python SDK with API v0.5.0 ([#41](#41)) ([043287a](043287a)) ### Bug Fixes * accept metadata without retired capacity fields ([#47](#47)) ([5547614](5547614)) ### Documentation * adopt strategic pragmatism guidance ([#42](#42)) ([7484eb2](7484eb2)) Companion to API !210. Solver PR #46 remains excluded.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds typed Python scenario evaluation and spot solving, plus a runnable SDK example app that supplies the solver-client acceptance demonstration for API #34 and API #146.
Both sync and async clients expose
evaluate_scenarios()andsolve_spot(), with quotes and explicit CU ceilings. BSM/BS1993 results retain ordered partial errors, point/interval boundaries, sign regions, unresolved coverage and commercial receipts. The approved flat solve rates are 100 CU BSM / 200 CU BS1993.The solver example app runs locally with the installed SDK and no extra runtime dependencies. Its browser form supports target option price and signed-position P&L, fixed scenario assumptions and bounded spot search. Quote and Solve are separate explicit actions; below-quote caps and stale/reused quotes are refused locally. Input edits invalidate results while preserving receipt history. Numerical work stays in the API, with no hidden pricing requests or automatic retries. Also includes command-line examples and standalone scenario/solver notebooks.
The contract is pinned byte-for-byte to API MR !209 commit
7b4f233b2222fbb95b2492d5c57dbde1ac32e571, SHA-25638a0c933ea805f132bc4245867c3130c5a1db94e23cb4837872abf8c27e33ccc. Native fixtures preserve original capture and validation provenance.Validation:
--helpoutside the checkout with only the installed wheel.Open client acceptance check: complete the documented browser walkthrough and attach rendered evidence. Computer-use URL policy blocked visual verification; automated app/native checks are not claimed as visual sign-off. This remains tracked in API #34/#146 and SDK #45.
Owner deployment hold: keep this PR draft and auto-merge off. Do not merge to main or release until the matching API has been deployed and live schema, scenario permissions, authenticated quotes and 100/200-CU receipts have been verified. This PR does not authorize deployment, signed-policy activation or publication.
Closes #45. Related: #2, #6, #7; API #34 and #146. Portfolio scenarios and attribution remain separate work.