SDK protocol prototype¶
Not a supported distribution
These contracts are preserved for convergence work. Their three HTTP routes have no server implementation in this repository, so the SDK wheel is release-blocked.
Client¶
zeroth.sdk ¶
HTTP client for Zeroth's hosted optimization API.
ZerothClient ¶
ZerothClient(
*,
api_key: str,
base_url: str,
timeout: float = 10.0,
backtest_timeout: float = 120.0,
http_client: Client | None = None,
)
Send workflow evidence and decision requests to a Zeroth service.
record_execution ¶
Record the measured cost of one workflow step.
record_outcome ¶
Attach a business outcome to a workflow run.
create_outcome_definition ¶
Declare the immutable success rule for a workflow version (Admin only).
record_charge_cost_revision ¶
Append a replacement cost assertion for an existing physical charge.
list_charge_cost_revisions ¶
Read the most recent source assertions, newest first (at most 1000).
create_backtest ¶
Submit a candidate workflow change for economic backtesting.
list_backtests ¶
List immutable hosted backtest results for the current project.
compare_versions ¶
Request an evidence-gated economic decision for a workflow change.
create_decision_schedule ¶
Create a recurring economic workflow-version comparison.
list_decision_schedules ¶
List recurring economic comparisons for the current project.
deactivate_decision_schedule ¶
Idempotently deactivate one recurring economic comparison.
list_decisions ¶
List retained economic decisions, optionally for one workflow.
create_model_migration_decision ¶
Simulate and retain a risk-calibrated model migration decision.
list_model_migration_decisions ¶
List retained probabilistic model migration decisions.
refresh_model_migration_decision ¶
Harvest current telemetry, simulate, and retain a fresh decision.
create_probabilistic_decision_schedule ¶
create_probabilistic_decision_schedule(
request: ProbabilisticDecisionScheduleRequest,
) -> dict[str, Any]
Schedule fresh evidence harvesting and probabilistic reevaluation.
deactivate_probabilistic_decision_schedule ¶
Idempotently deactivate one probabilistic reevaluation schedule.
create_randomized_rollout ¶
Create a randomized verification rollout for a retained decision.
stop_randomized_rollout ¶
Idempotently stop one randomized rollout.
assign_randomized_rollout ¶
assign_randomized_rollout(
rollout_id: str,
*,
subject_id: str,
cohort: str = "default",
) -> dict[str, Any]
Get the persisted random assignment for one stable subject.
verify_randomized_rollout ¶
verify_randomized_rollout(
rollout_id: str, request: RandomizedRolloutVerifyRequest
) -> dict[str, Any]
Verify causal effects and append calibration observations.
create_decision_report ¶
Create or retrieve the immutable PDF for a retained decision.
download_decision_report ¶
Download one authenticated PDF decision artifact.
deliver_decision_report ¶
Email an exact report artifact or authenticated report link.
ZerothAPIError ¶
ZerothAPIError(
*,
response: Response,
detail: str,
request_id: str | None,
correlation_id: str | None,
)
Bases: HTTPStatusError, ZerothSDKError
A sanitized non-success API response compatible with HTTPX catches.
ZerothAuthenticationError ¶
ZerothAuthorizationError ¶
ZerothConflictError ¶
ZerothEntitlementError ¶
ZerothNotFoundError ¶
ZerothRateLimitError ¶
ZerothSDKError ¶
Bases: Exception
Base class for failures raised by the Zeroth SDK.
ZerothServerError ¶
ZerothTransportError ¶
Bases: RequestError, ZerothSDKError
A sanitized network transport failure compatible with HTTPX catches.
ZerothValidationError ¶
Protocol¶
zeroth.protocol ¶
Public request and event contracts shared with Zeroth Cloud.
BacktestCase ¶
Bases: BaseModel
Ephemeral input and expected output used for one bounded replay.
BacktestRequest ¶
Bases: BaseModel
Candidate workflow change and the boundaries used to judge it.
DecisionPolicy ¶
Bases: BaseModel
Evidence and economic constraints for a workflow-version decision.
DecisionScheduleRequest ¶
Bases: BaseModel
Create a recurring economic comparison for two workflow versions.
EconomicConstraints ¶
Bases: BaseModel
Quality and economic boundaries a backtest candidate must satisfy.
ExecutionEvent ¶
Bases: BaseModel
Caller-reported cost and latency for one workflow step; missing cost is unknown.
ForecastCalibrationObservation ¶
Bases: BaseModel
One forecast-versus-observed period used for server-side calibration.
ForecastReadiness ¶
Bases: BaseModel
Calibration and drift status attached to a forecast evidence snapshot.
MigrationEvidence ¶
Bases: BaseModel
Paired model evidence and observed demand periods for one workload.
MigrationObservation ¶
Bases: BaseModel
One paired incumbent or candidate outcome used by the scenario engine.
MigrationRiskPolicy ¶
Bases: BaseModel
Customer-owned chance constraints and CVaR limit for model migration.
OutcomeEvent ¶
Bases: BaseModel
Business acceptance signal associated with a workflow run.
ProbabilisticMigrationRequest ¶
Bases: BaseModel
Request a retained Monte Carlo model-migration recommendation.
VersionComparisonRequest ¶
Bases: BaseModel
Request an evidence-gated comparison of two exact workflow versions.
SourceWindowInventory ¶
Bases: BaseModel
execution_ids_digest ¶
Hash exact unique IDs in UTF-8 byte order, shared with explicit HTTP callers.