Shared contracts for OSP providers and orchestrator.
Project description
osp-provider-contracts
Shared Python contract package for OSP providers and orchestrator: typed interfaces, canonical errors, capabilities schema, idempotency helpers, and a reusable provider conformance kit.
For maintainer-facing internals and invariants, see src/README.md.
Scope (v0.1)
- Small, explicit provider protocol
- Shared request/result/context types
- Canonical error taxonomy with retry metadata
- Capabilities and manifest v2 schema validation
- Conformance assertions and a reusable pytest suite for provider CI
- Canonical gate reason enum for approval-required flows
No pytest plugin is included. Providers opt in by subclassing the conformance suite from a local test module.
Approval-Required Contract
Providers that need human approval should raise ValidationError with
detail="approval_required" and include a structured extra payload:
gate_reason: one ofosp_provider_contracts.GateReasonstring valuesimportance: integer risk/urgency indicator when applicable (1 => 2 approvals)required_approvals: optional explicit total quorum override (e.g., 2 for dual control)reason: stable machine-readable reason stringdetails: provider-specific context for operators and audit
Providers do not send approval-authority tiers. required_approvals only
requests the total number of approvals. The orchestrator may add fixed-tier
requirements from gate policy, such as provider-admin sudo or global
break-glass approval, without changing provider payloads.
Install
pip install osp-provider-contracts
Development
env -u VIRTUAL_ENV uv sync --extra dev
hatch shell
hatch run dev:check
hatch run dev:build
hatch run dev:verify
Release
See docs/release.md for the manual/gated publish flow.
Tag and push:
git tag v0.2.0
git push origin v0.2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file osp_provider_contracts-0.2.19.tar.gz.
File metadata
- Download URL: osp_provider_contracts-0.2.19.tar.gz
- Upload date:
- Size: 79.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
180b0c0a46c40b0885321f31eb4b709e97ac61c44aaf7caa910ec56a09c71c94
|
|
| MD5 |
64d35d7673a93c44ccbf8925ccb8d89a
|
|
| BLAKE2b-256 |
cedab3899dc7ec32c338442d81688e54f82cd4fee5beea53855b8b65292983ba
|
File details
Details for the file osp_provider_contracts-0.2.19-py3-none-any.whl.
File metadata
- Download URL: osp_provider_contracts-0.2.19-py3-none-any.whl
- Upload date:
- Size: 38.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7627b6361b584bdbdf2cb0746231bc7722b84017694e90e94f6a81462e3e0ff8
|
|
| MD5 |
1fb41b526533933d839233800bec681a
|
|
| BLAKE2b-256 |
fb993562b7c65aebbe0c97b40e56399617ca0814cd938551e662e30b481906df
|