Skip to main content

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 lightweight conformance assertions.

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 schema validation
  • Conformance assertions for provider test suites
  • Canonical gate reason enum for approval-required flows

No pytest plugin is included in v0.1.

Approval-Required Contract

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

  • gate_reason: one of osp_provider_contracts.GateReason string values
  • importance: integer risk/urgency indicator when applicable (1 => 2 approvals)
  • required_approvals: optional explicit quorum override (e.g., 2 for dual control)
  • reason: stable machine-readable reason string
  • details: provider-specific context for operators and audit

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osp_provider_contracts-0.2.14.tar.gz (64.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

osp_provider_contracts-0.2.14-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

Details for the file osp_provider_contracts-0.2.14.tar.gz.

File metadata

  • Download URL: osp_provider_contracts-0.2.14.tar.gz
  • Upload date:
  • Size: 64.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for osp_provider_contracts-0.2.14.tar.gz
Algorithm Hash digest
SHA256 409883f3f1f246b0e84072c9aba158b0353cd99e208eb386a46d75564a854a9f
MD5 dd95324b22add5a4fb274731c7cd9962
BLAKE2b-256 f2fd5377bb7487b959c7b684f771231c752fddae6846c87015c6a25ba8dae790

See more details on using hashes here.

File details

Details for the file osp_provider_contracts-0.2.14-py3-none-any.whl.

File metadata

File hashes

Hashes for osp_provider_contracts-0.2.14-py3-none-any.whl
Algorithm Hash digest
SHA256 ef5d5b83990427900e518a716fa6a7d2e8647af3815d103b7fc175d74ffccf7a
MD5 456d1f1c0bddfec8105a85e74933a75c
BLAKE2b-256 395dba87588e8cc2181a8a8933a8caa725f14835c0d181ba4c69e238ae46b236

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page