Skip to main content

Deterministic, prompt-free receipts for AI workload consumption

Project description

YY Workload Receipt

YY Workload Receipt (wlr) creates deterministic, content-free receipts from AI workload usage metadata. It gives developers a small, local artifact they can verify after it is copied, archived, or shared without collecting prompts or tool payloads.

Use it to answer a narrow question:

What measurable resources and operations did this run consume, and has its receipt changed since it was generated?

The package has no runtime dependencies and makes no model or API calls.

Installation

Install a published release from PyPI:

python -m pip install yy-workload-receipt

Before the first PyPI release, install a release wheel directly:

python -m pip install ./yy_workload_receipt-0.1.0-py3-none-any.whl

Python 3.10 or newer is required.

Quick start

Generate a receipt from portable JSONL events and verify it later:

wlr receipt ./events.jsonl -o ./receipt
wlr verify ./receipt

The same commands are available through the module entry point:

python -m yy_workload_receipt receipt ./events.jsonl -o ./receipt
python -m yy_workload_receipt verify ./receipt

receipt writes exactly three files:

  • summary.json: canonical aggregate measurements and explicit evidence gaps.
  • report.md: a deterministic human-readable view of the same receipt.
  • manifest.sha256: SHA-256 hashes covering both artifacts.

verify fails when either covered artifact is missing or changed, when the manifest is malformed or incomplete, or when the receipt directory contains an unexpected entry. Symbolic links cannot stand in for covered artifacts.

OpenAI Agents SDK usage adapter

The openai-usage adapter accepts the JSON object returned by the OpenAI Agents SDK public agents.usage.serialize_usage(...) helper. It does not inspect traces:

wlr receipt ./usage.json -o ./receipt --adapter openai-usage \
  --run-id run-001 --observed-at 2026-07-31T12:00:00Z \
  --provider openai --model example-model

In PowerShell, replace each trailing \ with a backtick. The adapter requires per-request usage entries. It reports disagreements between those entries and aggregate counters as evidence gaps rather than silently choosing one value. A sanitized input and generated receipt are available under examples/.

Portable JSONL format

Each non-empty line is one flat JSON event:

{"schema_version":"0.1","run_id":"run-001","seq":1,"ts":"2026-07-31T12:00:00Z","kind":"model_call","provider":"openai","model":"example-model","tokens_input":120,"tokens_output":30,"tokens_cached":0,"tokens_reasoning":0,"duration_ms":850}

Supported event kinds are model_call, tool_call, approval, retry, and error. See yy_workload_receipt.model.ALLOWED_FIELDS for the complete flat schema.

Unknown fields are discarded and reported without reproducing their names or values. Common content-bearing fields, including prompt, message, content, arguments, and payload fields, cause the entire line to be rejected without reproducing the field name or value in output.

Exit codes

Code Meaning
0 Receipt generation or verification completed successfully.
1 Input, build, I/O, or verification failed.
2 A partial JSONL receipt was written, but one or more input lines were rejected.

Treat exit code 2 as incomplete evidence. Inspect the evidence gaps before using or sharing the receipt.

Privacy and security boundary

This project is designed for metadata, not content. Do not put prompts, messages, tool arguments, tool results, credentials, personal data, or raw exception messages into an input file. Its allowlist and rejection rules reduce accidental retention; they are not a substitute for reviewing data before it is shared.

The tool does not provide an observability dashboard, billing or cost estimate, security audit, compliance certification, or hardware recommendation. Missing observations remain explicit evidence gaps rather than assumed zeroes. The future hardware-analysis input boundary is documented, without an implementation, in docs/hardware-fit-input-contract.md.

Development

python -m venv .venv
python -m pip install -e ".[dev]"
python -m ruff check .
python -m pytest
python -m build
python -m twine check dist/*

See CONTRIBUTING.md for the initial contribution boundary, SUPPORT.md for support expectations, and SECURITY.md for private vulnerability reporting.

License

Licensed under Apache License 2.0. See LICENSE and NOTICE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yy_workload_receipt-0.1.0.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yy_workload_receipt-0.1.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file yy_workload_receipt-0.1.0.tar.gz.

File metadata

  • Download URL: yy_workload_receipt-0.1.0.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for yy_workload_receipt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5e5b9ac75ea0e2f9d5238acde6fc81f1719271503ef8040126a70ed8c958877f
MD5 9568f91f3f6d1f9fb240b8c2e870368a
BLAKE2b-256 b9e88638f0b109420de46fc16cefd82a0b82967158d82de1808b5dee6707fe3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for yy_workload_receipt-0.1.0.tar.gz:

Publisher: publish.yml on yycore/yy-workload-receipt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yy_workload_receipt-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for yy_workload_receipt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5006ea2e7f15cc70548668874f54488e18c6aed0213540f0169c4e83a691e7bd
MD5 db3d64e9ea1ddf34ccd0f61752fbc5d7
BLAKE2b-256 ab0bf4bf63e978fadf77d4353a779546c8291af12eaf7b08dbfa02baa360462b

See more details on using hashes here.

Provenance

The following attestation bundles were made for yy_workload_receipt-0.1.0-py3-none-any.whl:

Publisher: publish.yml on yycore/yy-workload-receipt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page