aap-ref-lib-py
Python reference implementation of the Agent Acknowledgment Protocol (AAP) — typed acknowledgment events, the §7.2 reference weighting function, and a simple reputation derivation.
Install
pip install aap-manifest
What's in the box
| Module | Spec | Purpose |
|---|---|---|
entries |
§3, §4 | AcknowledgmentEvent and its parts; the AckType vocabulary |
weighting |
§7.2 | compute_weight, type_weight, DEFAULT_TYPE_WEIGHTS |
reputation |
§7.1 | compute_reputation — derive a subject's score from events |
store |
§9.3 / §9.4 | InMemoryAcknowledgmentStore — dup-id rejection, withdrawal handling |
Usage
from aap_manifest import (
AcknowledgmentEvent, Issuer, Subject,
compute_weight, InMemoryAcknowledgmentStore,
)
ev = AcknowledgmentEvent(
id="urn:uuid:5f8a3c2e-…",
type="ENDORSEMENT",
issuer=Issuer(did="did:tutus:0xacme", key_id="did:tutus:0xacme#k"),
subject=Subject(did="did:web:example.com:agents:code-reviewer"),
signature=Signature(alg="EdDSA", value="…"),
issued_at="2026-05-20T14:32:00Z",
)
result = compute_weight(ev, issuer_trust=0.8) # value_weight applies only when verified
store = InMemoryAcknowledgmentStore()
store.append(ev) # raises on duplicate id (§9.3)
rep = store.reputation("did:web:example.com:agents:code-reviewer")
Reference weight (spec §7.2)
weight = type_weight × issuer_trust × value_weight × witness_factor × time_decay
value_weight = 1 + log10(1 + usd_equivalent)applies only when the settlement reference is verified (§6.3); otherwise 1.witness_factor = 1 + 0.25 × min(independent_witnesses, 4).time_decay = exp(−Δt/τ), τ = 18 months; omitnowfor no decay.- A
WITHDRAWALzeroes the weight (positive-only vocabulary, §9.1).
This is the informative AAP reference. The normative aggregation —
issuer-diversity penalty, recursive-trust bound, mandatory settlement
verification — lives in AAR §9 and ships in the aar-manifest package.
How It Composes
aap-manifest constructs and weights acknowledgment events (this library)
aar-manifest stores, chains, federates, and aggregates them
aap-validate validates events against the schema + anti-abuse rules
Test
pip install -e ".[dev]"
pytest
License
Metadata
Release files for aap-manifest 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aap_manifest-1.0.0.tar.gz | 13.2 kB | Without provenance | Details for aap_manifest-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aap_manifest-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for aap_manifest-1.0.0-py3-none-any.whl |
Total release size: 26.2 kB
Release files / aap_manifest-1.0.0.tar.gz
| Download URL | aap_manifest-1.0.0.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
abb556e28a50f26488e44f7f63bd8124f827799e31a84b9b48abc8b42fdecb7d
|
|
BLAKE2b-256 checksum How to use checksums |
967fa0750af497f2ccbfd6862f66b11c99dfcb81a7e4f88ae37286d41cc49df5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.3
|
Release files / aap_manifest-1.0.0-py3-none-any.whl
| Download URL | aap_manifest-1.0.0-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0164052efa9c55608cf9db89d0bae5d68875471abcb96b13e9cc5c584a4c4c4b
|
|
BLAKE2b-256 checksum How to use checksums |
935ff0185894bc1dad67529280540e2f6d9eb4aa867c66c50d5dbc30cb3bf034
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.3
|
Security for aap-manifest 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.