Metadata-Version: 2.4
Name: pfc-core
Version: 0.1.0
Summary: Shared PFC client, payload models, and enforcement helpers for integration adapters
License: MIT
Keywords: pfc,policy,governance,agents,integration
Author: Dan Evans
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: requests (>=2.31,<3.0)
Project-URL: Homepage, https://example.com/pfc-integrations
Project-URL: Repository, https://example.com/pfc-integrations
Description-Content-Type: text/markdown

# pfc-core

`pfc-core` provides the shared building blocks used by the adapter packages in
this repository. It contains the PFC client, payload helpers, and enforcement
primitives that power execution-boundary decisions.

## What It Does

- Sends execution-boundary evaluation requests to PFC
- Builds consistent decision payloads for adapter packages
- Raises a shared blocked exception when PFC denies execution

## Install

From this monorepo:

```bash
pip install -e ./packages/pfc_core
```

## Quick Start

```python
from pfc_core.client import PFCClient
from pfc_core.models import build_payload
from pfc_core.middleware import enforce

client = PFCClient("pfc_test_key")
payload = build_payload("demo_tool", {"value": 1}, "policy-123", framework="custom")
decision = {"allow": True, "decision_id": "demo", "receipt_hash": "receipt"}

print(payload)
print(enforce(decision))
```

## How It Works

1. `build_payload` creates a normalized execution request structure.
2. `PFCClient` sends that payload to the configured PFC API endpoint.
3. `enforce` raises when a returned decision blocks execution.

## Failure Behavior

- `PFCClient` raises an exception if the API request fails or returns a non-200 response.
- `enforce` raises `PFCBlockedError` when `allow` is falsey.

## Limitations

- This package is intentionally small and does not manage framework-specific wrappers.
- It assumes the caller is responsible for constructing appropriate framework context.
- It does not bundle retries, tracing, or policy authoring features.

