Metadata-Version: 2.4
Name: proof-engine-registry
Version: 1.33.1
Summary: Proof Registry protocol: client, reference server, and static-JSON emitter.
Author-email: Yaniv Golan <yaniv@lool.vc>
License: MIT License
        
        Copyright (c) 2026 Yaniv Golan
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://proofengine.info
Project-URL: Repository, https://github.com/yaniv-golan/proof-engine
Project-URL: Documentation, https://github.com/yaniv-golan/proof-engine/blob/main/docs/registry-protocol.md
Project-URL: Issues, https://github.com/yaniv-golan/proof-engine/issues
Project-URL: Changelog, https://github.com/yaniv-golan/proof-engine/blob/main/CHANGELOG.md
Project-URL: Source, https://github.com/yaniv-golan/proof-engine/tree/main/packages/proof-engine-registry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31
Requires-Dist: tomli>=2.0; python_version < "3.11"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: jsonschema>=4.0; extra == "test"
Dynamic: license-file

# proof-engine-registry

Protocol, client, and reference server for the Proof Registry — the
JSON-over-HTTPS layer that lets LLM wikis (and other tools) ask
"is this claim already proven?" and either use the existing proof or
commission a new one.

Spec: [`docs/registry-protocol.md`](../../docs/registry-protocol.md).

## Install

    pip install proof-engine-registry

## Config

    ~/.config/proof-engine/registries.toml

```toml
[[registry]]
name = "public"
url = "https://proofengine.info"

[[registry]]
name = "acme-internal"
url = "https://proofs.acme.com"
token_env = "ACME_PROOFS_TOKEN"
publish = true
```

## Client

```python
from proof_engine_registry import RegistryClient, load_registries
client = RegistryClient(load_registries())
hit = client.lookup("The sky is blue.")
if hit:
    print(hit.proof_url)
```

## Self-host

    proof-registry serve ./my-proofs --port 8080 --token-env MY_TOKEN

Useful flags:

| Flag                  | Default                              | Purpose                                                                                              |
|-----------------------|--------------------------------------|------------------------------------------------------------------------------------------------------|
| `--token-env`         | (none)                               | Env var holding the bearer token required for `POST /proofs`. Omit to disable publishing.            |
| `--cors-origin`       | `*`                                  | Value for `Access-Control-Allow-Origin` on read responses. Use a specific origin to restrict access. |
| `--log-json`          | off                                  | Emit one JSON access record per request to stderr. Authorization headers are never logged.           |
| `--problem-type-base` | `https://proofengine.info/errors`    | Base URI for `type` fields in RFC 7807 error bodies. Override to point at your own docs.             |

### Production deployment

The reference server uses plain stdlib HTTP and binds to `127.0.0.1` by
default. Suitable for development and local team use. **For public
exposure over the open internet**, front the server with a TLS-terminating
reverse proxy (nginx, Caddy, Cloudflare, AWS ALB) and route only
encrypted traffic from the proxy to the server. Bearer tokens MUST NOT
travel the network in cleartext.

## Errors

JSON error responses follow [RFC 7807 Problem Details](https://datatracker.ietf.org/doc/html/rfc7807):

```http
HTTP/1.1 404 Not Found
Content-Type: application/problem+json

{
  "type": "https://proofengine.info/errors/not-found",
  "status": 404,
  "title": "Resource not found",
  "detail": "no proof with that claim_hash",
  "code": "not_found"
}
```

The `code` field preserves the legacy short machine key for
log-aggregation tooling. Full canonical-error table in the
[protocol spec](../../docs/registry-protocol.md).

## Conformance

A protocol-version-aware conformance suite ships with the package:

    cd packages/proof-engine-registry && python -m pytest tests/test_conformance.py -v

It runs against both the static-JSON emit and the reference server.
Any third-party server claiming to speak the protocol can run the same
suite.
