Metadata-Version: 2.5
Name: openframe-protocol-base
Version: 0.4.0
Summary: OpenFrame Microservice Suite - shared transport-neutral protocol mechanics (error mapping, RequestContext construction, inbound conformance suite).
Project-URL: Homepage, https://github.com/Furious-Meteors/openframe-protocol
Project-URL: Documentation, https://furious-meteors.github.io/openframe-protocol/
Project-URL: Repository, https://github.com/Furious-Meteors/openframe-protocol
Project-URL: Changelog, https://github.com/Furious-Meteors/openframe-protocol/blob/production/.github/CHANGELOG.md
Project-URL: Bug Tracker, https://github.com/Furious-Meteors/openframe-protocol/issues
Author-email: Furious Meteors Engineering <engineering@furiousmeteors.dev>
Maintainer-email: Furious Meteors Engineering <engineering@furiousmeteors.dev>
License: MIT
Keywords: hexagonal,microservice,openframe,protocol
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: openframe-core<4,>=3.2.1
Requires-Dist: opentelemetry-api>=1.24
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-mock>=3.14; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# openframe-protocol-base

Shared, transport-neutral mechanics every `openframe-protocol-*` binding
package builds on. No transport dependencies of its own.

- `errors.py` — `categorize(exc) -> ErrorCategory` and `build_envelope(exc)`,
  the one place every transport maps `OpenFrameError` (and anything else)
  to a caller-safe error shape.
- `context.py` — `build_request_context(headers)`, building
  `openframe.core.inbound.RequestContext` consistently across transports
  (trace id, then a correlation header, then a generated uuid4).
- `testing.py` — `TransportConformanceTests` + `TransportDriver`, the
  suite every binding proves itself against.

## Wiring example

```python
from openframe.protocol.base import build_envelope, build_request_context

context = build_request_context(request.headers)
try:
    result = await handler.execute(command, context)
except Exception as exc:
    envelope = build_envelope(exc, correlation_id=context.correlation_id)
    # serialise envelope in whatever shape this transport uses
```

## Status

Experimental — incubating the inbound conformance suite here until two
transports (HTTP, gRPC) both pass it for real, per the project's own
rule-of-three discipline for promoting shared infrastructure into
`openframe-core`.
