Skip to main content

Approval Ledger

Hash-bound human approval and idempotent dispatch for automated actions.

Approval Ledger is deliberately channel-neutral. It does not know about social networks, email providers, recipients or credentials. It stores an action's canonical JSON digest, required gate results, the approval attached to that exact digest and one durable dispatch result.

Install

pip install approval-ledger

Example

from approval_ledger import SQLiteLedger

ledger = SQLiteLedger("ledger.sqlite3")
action = ledger.create_action(
    {"target": "draft", "body": "Human-approved message"},
    required_gates=("artifact-qa",),
)
ledger.record_gate(action.id, action.digest, "artifact-qa", passed=True)
ledger.approve(action.id, action.digest, approver="editor@example.test")

receipt = ledger.dispatch(
    action.id,
    lambda payload, key: "provider-delivery-id",
)
assert receipt.status == "completed"

Safety model

  • A changed payload has a different SHA-256 digest and needs a new approval.
  • Required gates must pass before approval.
  • A dispatch reservation is durable before the callback runs.
  • A transport exception produces indeterminate state; the library does not retry and risk duplicate delivery.
  • The package makes no claim of legal approval, content compliance or cryptographic signer identity.

Use a real authenticated audit identity and an application-specific transport outside this package.

Development

PYTHONPATH=src python -m unittest discover -s tests -v
uv build

License

MIT. See LICENSE.

Download files

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

Source Distribution

approval_ledger-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

approval_ledger-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for approval_ledger-0.1.0.tar.gz
Algorithm Hash digest
SHA256 73916ec3576776980fbaf1bcde5240995464f23abe5ed59e9cf9bbcb1e8f3eb2
MD5 e027f4d92408197a624206799fc64470
BLAKE2b-256 356c8919b7a6498403f6219af8b5684bfae3a27eb59f1240bf61c3d62c2f6376

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on Mihailorama/approval-ledger

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

File details

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

File metadata

File hashes

Hashes for approval_ledger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b20a8cfe6826e504ee4d8470dbb8773c319463b1684d159c309ca653b6933b89
MD5 7b7fbb03457cdc2913ea97dbe4252c39
BLAKE2b-256 723d05ac1d67357008df4c65f7bbb90026c067adbc7d802bdfb9e5ae5b23af7d

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on Mihailorama/approval-ledger

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page