Skip to main content

Thin runtime harness for OSP providers (RabbitMQ transport + contract execution).

Project description

osp-provider-runtime

Thin, boring runtime harness for OSP providers.

This package handles RabbitMQ message plumbing so provider implementations can focus on business logic.

What it does (v0.1)

  • Parses a versioned request envelope.
  • Builds provider RequestContext/ProviderRequest and calls execute(...).
  • Serializes a standard response envelope.
  • Applies explicit ack/requeue/dead-letter decisions.
  • Emits structured logs for delivery decisions.
  • Supports explicit runtime knobs for prefetch/concurrency/retries/timeouts/DLQ.
  • Accepts contract_v1 request envelopes.

Result payload conventions

Provider results should keep ProviderResult.data focused on the resolved values for the task. The runtime builds the full update payload envelope:

  • requested: request payload from the orchestrator
  • resolved: your ProviderResult.data (after runtime normalization)
  • provenance: optional; extracted from ProviderResult.data["provenance"]
  • dry_run: derived from the request payload

Special keys in ProviderResult.data:

  • progress_events (list): lifted into the update payload and removed from resolved to avoid duplicate TaskEvent rows.
  • provenance (dict): lifted into the top-level provenance field.

Avoid embedding envelope-shaped keys (requested, resolved, request_input, request_defaults) inside ProviderResult.data. The runtime will drop them to keep the stored result compact and predictable.

What it does not do

  • No provider framework.
  • No plugin system.
  • No workflow orchestration.

Install

pip install osp-provider-runtime

Development

env -u VIRTUAL_ENV uv sync --extra dev
hatch shell
hatch run dev:check
hatch run dev:build
hatch run dev:verify

Runtime Knobs

Set these via RuntimeConfig in your provider runtime_app.py:

  • prefetch_count (default 1)
  • concurrency (default 1)
  • max_attempts (default 5)
  • idempotency_cache_max_entries (default 1024)
  • handler_timeout_seconds (optional)
  • dead_letter_exchange (optional)
  • dead_letter_routing_key (optional)
  • heartbeat_seconds (default 60)
  • blocked_connection_timeout_seconds (default 30)
  • updates_signing_enabled (default False)
  • updates_signing_kid (required when signing enabled)
  • updates_signing_secret (UTF-8 shared secret; set this or _b64)
  • updates_signing_secret_b64 (base64-encoded shared secret; preferred for random bytes)

Update Emission

Use TaskReporter for provider task lifecycle updates. The runtime keeps transport details compatible with orchestrator consumers.

Docs:

  • docs/runtime-contract.md
  • docs/provider-updates.md
  • docs/migration-task-reporter.md
  • docs/runtime-upgrade-checklist.md
  • docs/release-notes-task-reporter.md

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_runtime-0.2.19.tar.gz (84.3 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_runtime-0.2.19-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

Details for the file osp_provider_runtime-0.2.19.tar.gz.

File metadata

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

File hashes

Hashes for osp_provider_runtime-0.2.19.tar.gz
Algorithm Hash digest
SHA256 07125a34374c6a87ebff262913d882aa25bdbae3ad15dd496ee3ef72dc1374fd
MD5 ab6b2384c79eea9c6c9c12a1c3dd4131
BLAKE2b-256 3d0b3fe6440709b6f09e73652bdf8829c6932a8a4529eecb9b7766c1a6ccf9dd

See more details on using hashes here.

File details

Details for the file osp_provider_runtime-0.2.19-py3-none-any.whl.

File metadata

File hashes

Hashes for osp_provider_runtime-0.2.19-py3-none-any.whl
Algorithm Hash digest
SHA256 3a2b5b0dcd9fce22ced24697c5bdb0182648fb73d50181b5dca0871a7bf94908
MD5 c6a03a3c30283293491165a3a7a45484
BLAKE2b-256 84e51c84f22203e596f3666735122f7498082f1f564e9d07d7fe099684db597c

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