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 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 of osp_provider_contracts.GateReason string values
  • importance: 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 string
  • details: 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


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.21.tar.gz (87.6 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.21-py3-none-any.whl (44.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: osp_provider_contracts-0.2.21.tar.gz
  • Upload date:
  • Size: 87.6 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.21.tar.gz
Algorithm Hash digest
SHA256 0d433d7758bbbb654019c518915b1c5ccdc9553bb2bc6b43d35867d49ab5f831
MD5 47a08798ce6e0d84659408e1cad262ef
BLAKE2b-256 15d475342db03c43b6b99c688b47ccded77a45dc3c51649cdf7616f758cb7040

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for osp_provider_contracts-0.2.21-py3-none-any.whl
Algorithm Hash digest
SHA256 715d4e9bbe2c3c66c91e47dca8c52cf3d352a42a5ab110350bb8758a1d4025e4
MD5 9eb542e2433d8ae8c2db9ed795c1038e
BLAKE2b-256 28eee0c36bf4139e6edf53266cfdfbfcc5f06e078b3493296dbd70c5af433521

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