Skip to main content

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
  • One executable-mode vocabulary (check or apply)
  • 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.

Execution

Planning is read-only and does not execute provider actions. An executed task is either ExecutionMode.CHECK when its canonical dry_run or check flag is true, or ExecutionMode.APPLY otherwise:

from osp_provider_contracts import ExecutionMode, resolve_execution_mode

mode = resolve_execution_mode(request.payload)
if mode is ExecutionMode.APPLY:
    create_vm()

The resolver deliberately ignores a payload's execution_mode string so an ordinary dispatched task cannot become an unmarked successful no-op.

Approval-Required Contract

Providers that need human approval should raise ValidationError with detail="approval_required" and include a structured extra payload:

  • gate_key: provider-stable identity for this policy hold
  • approval_kind: peer, maintainer, or admin
  • required_approvals: explicit positive quorum
  • reason and message: policy explanation and user-facing consequence
  • violations and tags: structured provider evidence

The provider states the complete decision requirement. The orchestrator stores and evaluates it without deriving authority from reason strings.

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

Release files for osp-provider-contracts 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for osp-provider-contracts 0.4.2
File Size Uploaded
osp_provider_contracts-0.4.2.tar.gz 68.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for osp-provider-contracts 0.4.2
File Interpreter ABI Platform
osp_provider_contracts-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 124.5 kB

Release files / osp_provider_contracts-0.4.2.tar.gz

Download URL osp_provider_contracts-0.4.2.tar.gz
Size 68.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8815fde6a0c35f6a792b83649d0953bc5b040474410719de35036d20021fbd06
BLAKE2b-256 checksum
How to use checksums
3183066635b6c260fa474ae0ea06fd50fca17f99276f73537c2100b67e6a3856
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / osp_provider_contracts-0.4.2-py3-none-any.whl

Download URL osp_provider_contracts-0.4.2-py3-none-any.whl
Size 55.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3871d36a2dcfdfd6b2686f6fb70440bbbd573b11b35ed32780b767209f63180b
BLAKE2b-256 checksum
How to use checksums
8c504c804f7e1a371206179e20990c8a5ab7d144f8e8b198d2c33f3011b0bea3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

0.7.1

2 release files

0.7.0

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.22

2 release files

0.2.21

2 release files

0.2.20

2 release files

0.2.15

2 release files

0.2.14

2 release files

0.2.13

2 release files

0.2.12

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page