semvec/pypi-packages huggingface dataset:
osp-provider-runtime 0.2.11
Thin runtime harness for OSP providers (RabbitMQ transport + contract execution).
License: MIT
Requires Python: >=3.12

# 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.

## What it does not do

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

## Install

```bash
pip install osp-provider-runtime
```

## Development

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

Note: before `osp-provider-contracts` is published to your index, use `uv` for
local checks in this monorepo:

```bash
env -u VIRTUAL_ENV uv run ruff check .
env -u VIRTUAL_ENV uv run mypy src tests
env -u VIRTUAL_ENV uv run pytest
```

## Runtime Knobs

Set these via `RuntimeConfig` in your provider `runtime_app.py`:

- `prefetch_count` (default `1`)
- `concurrency` (default `1`)
- `max_attempts` (default `5`)
- `handler_timeout_seconds` (optional)
- `dead_letter_exchange` (optional)
- `dead_letter_routing_key` (optional)
- `heartbeat_seconds` (default `60`)
- `blocked_connection_timeout_seconds` (default `30`)
- `emit_legacy_updates` (default `True`)
- `emit_legacy_updates_for_contract_requests` (default `True`)

## 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:

```bash
git tag v0.2.0
git push origin v0.2.0
```
osp-provider-contracts 0.2.5
Shared contracts for OSP providers and orchestrator.
License: MIT
Requires Python: >=3.12

# 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 code 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_code`: one of `osp_provider_contracts.GateCode` values (4xx)
- `importance`: integer risk/urgency indicator when applicable
- `reason`: stable machine-readable reason string
- `details`: provider-specific context for operators and audit

## Install

```bash
pip install osp-provider-contracts
```

## Development

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

## Release

See `docs/release.md` for the manual/gated publish flow.

Tag and push:

```bash
git tag v0.2.0
git push origin v0.2.0
```