Metadata-Version: 2.5
Name: enderis
Version: 0.1.0
Summary: Tiny, local agent run receipts with deterministic SHA-256 fingerprints.
Author: Enderis contributors
License-Expression: MIT
License-File: LICENSE
Keywords: agents,fingerprint,json,receipts
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# enderis

A little receipt for what your agent was asked and what it answered.
Give it JSON-compatible input, output, and optional metadata; get a detached
snapshot with a deterministic SHA-256 fingerprint. No dependencies, accounts,
network calls, timestamps, or automatic instrumentation.

```sh
pip install enderis
```

```python
import json
from enderis import receipt

record = receipt(
    input="Schedule a meeting with Sam",
    output="Created a meeting for Tuesday at 10am",
    metadata={"agent": "calendar-assistant"},
)
print(json.dumps(record, indent=2))
print(record["fingerprint"])  # sha256:...
```

## API

`receipt(*, input, output, metadata=None)` returns a dict with `input`, `output`,
`metadata`, and `fingerprint`. Input and output are required; either may be `None`.
Metadata defaults to `{}` when omitted or `None`; otherwise it must be a dict
with string keys.
All values must be JSON data: null, booleans, finite numbers, Unicode strings,
lists, or dicts with string keys. Unsupported types, cycles, non-finite numbers,
and surrogate code points raise `TypeError` or `ValueError`.

The hash covers UTF-8 JSON of just `input`, `output`, and `metadata`, with keys
sorted recursively and no extra whitespace. Object insertion order does not
matter; array order does. Strings are preserved without Unicode normalization.
Fingerprints are stable for the same values in this implementation. They are
not a cross-language canonicalization standard: Python and JavaScript may
serialize numbers and sort keys differently.

The returned data is a deep copy. Mutating your original objects won't change
the receipt. Mutating the receipt itself makes its fingerprint stale. This is
a content fingerprint, not a signature or proof that an agent performed an
action. It does not capture enough information by itself to replay an agent.

Python 3.10+. A companion npm package is also named `enderis`.

## Development

```sh
PYTHONPATH=src python3 -m unittest discover -s tests -v
uv build --out-dir dist
```

## License

MIT. See [LICENSE](LICENSE). Source is included in the distribution.
