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/ProviderRequestand callsexecute(...). - 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.
- Provides
ProviderIdentityso providers derive the same RabbitMQ queue/binding, routing prefix, and signing source fromPROVIDER,PROVIDER_INSTANCE, and optionalPROVIDER_INSTANCE_ID.
Provider identity
Use a provider family for permissions and API requests, then add an instance only when you need a separate runtime lane:
from osp_provider_runtime import ProviderIdentity
identity = ProviderIdentity(
provider="nrec",
instance="pr",
instance_id=37,
)
identity.routing_prefix # "nrec.pr.37"
identity.request_queue # "provider.nrec.pr.37"
identity.request_binding # "nrec.pr.37.#"
identity.signing_provider # "nrec_pr"
The common case stays small: ProviderIdentity("vmware", "dev") gives the
vmware.dev routing prefix and vmware_dev signing source. Signing deliberately
uses only provider + instance, so all nrec.pr.<id> runtimes share the
nrec_pr signing scope without a separate override knob.
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 orchestratorresolved: yourProviderResult.data(after runtime normalization)provenance: optional; extracted fromProviderResult.data["provenance"]dry_run: derived from the request payload
Special keys in ProviderResult.data:
progress_events(list): lifted into the update payload and removed fromresolvedto avoid duplicate TaskEvent rows.provenance(dict): lifted into the top-levelprovenancefield.
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(default1)concurrency(default1)max_attempts(default5)idempotency_cache_max_entries(default1024)handler_timeout_seconds(optional)dead_letter_exchange(optional)dead_letter_routing_key(optional)heartbeat_seconds(default60)blocked_connection_timeout_seconds(default30)updates_signing_enabled(defaultFalse)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.mddocs/provider-updates.mddocs/migration-task-reporter.mddocs/runtime-upgrade-checklist.mddocs/release-notes-task-reporter.md
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_runtime-0.2.21.tar.gz.
File metadata
- Download URL: osp_provider_runtime-0.2.21.tar.gz
- Upload date:
- Size: 86.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 |
9314f92c5e74013ce45a03187d7b4459982924488842575223804ecdc016211b
|
|
| MD5 |
9400eebfa7347d9550d98f59c2897ac2
|
|
| BLAKE2b-256 |
edcd42c2cafd0e3189d52fbba81be17ed45d7aa9ca84bd1ddaad0209c97765a0
|
File details
Details for the file osp_provider_runtime-0.2.21-py3-none-any.whl.
File metadata
- Download URL: osp_provider_runtime-0.2.21-py3-none-any.whl
- Upload date:
- Size: 39.7 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 |
11e6e3692bec6121b34b54741fe457fe203501f07c789002238f2e85349c101d
|
|
| MD5 |
2604ae14435eb95ab23aefcd1981a29d
|
|
| BLAKE2b-256 |
06a86c3879533cc5d2d792e5224bab51916adce5fd29b7de83d05fb658576388
|